Skip to content

Instantly share code, notes, and snippets.

@geedmo
Created October 8, 2013 23:03
Show Gist options
  • Save geedmo/6893318 to your computer and use it in GitHub Desktop.
Save geedmo/6893318 to your computer and use it in GitHub Desktop.
snippet to chain sync methods to an initial async
// snippet to chain sync methods to an initial async
_then: function(f) {
this._q = this._q || [];
this._q.push(f);
return this;
},
// continue execution
_done: function() {
var m;
while( (m = this._q.shift()) )
m.call(this);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment