Skip to content

Instantly share code, notes, and snippets.

@jareware
Created December 2, 2014 09:05
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jareware/efa910c6283fd6be8598 to your computer and use it in GitHub Desktop.
Save jareware/efa910c6283fd6be8598 to your computer and use it in GitHub Desktop.
A simple PromiseQueue w/ ES6
function PromiseQueue() {
var tail = Promise.resolve();
return {
enqueueOperation(op) {
return tail = tail.then(op, op);
}
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment