Skip to content

Instantly share code, notes, and snippets.

@unscriptable
Last active July 1, 2016 22:56
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 unscriptable/32311cd09c5e9dfe52be to your computer and use it in GitHub Desktop.
Save unscriptable/32311cd09c5e9dfe52be to your computer and use it in GitHub Desktop.
// Sequence an array of promise-producing functions.
export const sequence
: (ops:Array<() => Promise>) => Promise
= ops =>
ops.reduce((p, op) => p.then(op), Promise.resolve())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment