Skip to content

Instantly share code, notes, and snippets.

@dogles
Created February 11, 2014 14:50
Show Gist options
  • Save dogles/8936228 to your computer and use it in GitHub Desktop.
Save dogles/8936228 to your computer and use it in GitHub Desktop.
ModelEntity.init = function(completion) {
var componentError = null;
var postFork = function() {
if ( componentError != null ) Log.error(componentError);
completion(componentError);
}
ForkJoin.fork(entity.m_components,function(component,join) {
component.onInit(function(error) {
if(error != null) componentError = error;
join(postFork);
});
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment