Created
June 23, 2019 11:01
-
-
Save N8python/98c3a2ad823a0e98a04ac08014c8ad5c to your computer and use it in GitHub Desktop.
An asynchronous, concurrent function for creating efficient, easy-to-understand promise pipelines.
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
async function fmait(callbacks, array) { | |
for (const callback of callbacks) { | |
array = await Promise.all(array.map(item => Promise.resolve(callback(item)))); | |
} | |
return array; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment