Created
September 1, 2016 11:42
-
-
Save cristobal/4758a603c7509386cd38c9f0ea6c5a1c to your computer and use it in GitHub Desktop.
Reduce a set of promises (S) over a a value x
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
const reducePromises = (S, x) => | |
S.reduce((f, g) => f.then(g), Promise.resolve(x)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Example code: