Created
May 27, 2015 22:19
-
-
Save hanikesn/8e5e26a255b867a2bb3f to your computer and use it in GitHub Desktop.
Javascript Helpers
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
var chain_deferreds = function (data, f) { | |
var start = jQuery.Deferred(); | |
var end = data.reduce(function (prev, d) { | |
return prev.then(function () { | |
return f(d); | |
}); | |
}, start); | |
start.resolve(); | |
return end; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment