Created
January 27, 2021 16:17
-
-
Save samthomson/0b3503212a3c76274db49285bd6d2f14 to your computer and use it in GitHub Desktop.
convert colleciton in to promises so that they can be awaited reliably
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
await Promise.all( | |
collection.map(async (item) => { | |
await doSomethingWith(item) | |
}), | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment