Last active
July 1, 2016 22:56
-
-
Save unscriptable/32311cd09c5e9dfe52be to your computer and use it in GitHub Desktop.
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
// 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