Created
February 9, 2017 08:23
-
-
Save dezinezync/9bd7ed6ba5c2aff59c04addc536d5c42 to your computer and use it in GitHub Desktop.
Run N Promises sequentially, irrespective of whether the previous promise passed or failed.
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 run = () => +new Date() | |
let arr = Array.from({length: 100}, run) | |
arr.reduce((x, y) => { | |
x.then(result => { | |
console.log(x) | |
return y | |
}, err => { | |
console.error(err) | |
return y | |
}) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment