Skip to content

Instantly share code, notes, and snippets.

@mrself
Created August 29, 2016 11:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mrself/eb5f1a0f1df2a10762a027351d92de7b to your computer and use it in GitHub Desktop.
Save mrself/eb5f1a0f1df2a10762a027351d92de7b to your computer and use it in GitHub Desktop.
// If you need chains
array.reduce(function(def, arrayItem) {
return def.then(function() {
// Access to arrayItem
// return $.get, $.post, $.ajax or another deferred
});
}, $.when()).done(function(){
// all deferred are completed
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment