Skip to content

Instantly share code, notes, and snippets.

@w0rm
Forked from keriati/callbackhell.js
Last active August 29, 2015 13:57
Show Gist options
  • Save w0rm/9618351 to your computer and use it in GitHub Desktop.
Save w0rm/9618351 to your computer and use it in GitHub Desktop.
var myObject = {
doSomeThingAsync: function() {
var that = this;
return asyncThing({
success: function() { that.onSuccess.apply(that, arguments);},
error: function() { that.onError.apply(that, arguments);},
complete: function() { that.onComplete.apply(that, arguments);}
})
},
onSuccess: function() {
},
onError: function() {
},
onComplete: function() {
}
}
@keriati
Copy link

keriati commented Mar 18, 2014

thanks :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment