Created
October 8, 2013 23:03
-
-
Save geedmo/6893318 to your computer and use it in GitHub Desktop.
snippet to chain sync methods to an initial async
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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