Skip to content

Instantly share code, notes, and snippets.

@pionize

pionize/.js Secret

Created April 27, 2017 07:51
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save pionize/2f38cad0cb232c18e8f6619d121d9acb to your computer and use it in GitHub Desktop.
function executeSequentially(promiseFactories) {
var result = Promise.resolve();
promiseFactories.forEach(function (promiseFactory) {
result = result.then(promiseFactory);
});
return result;
}
function myPromiseFactory() {
return somethingThatCreatesAPromise();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment