-
-
Save myndzi/b00ee9cc4fe83cc917a279b788dec9cf to your computer and use it in GitHub Desktop.
This file contains hidden or 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
function sequentially(array, promiseFn) { | |
return array.reduce((acc, current) => | |
acc.then(results => | |
promiseFn(current).then(res => | |
results.concat(res) | |
) | |
) | |
, Promise.resolve([]); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment