Last active
February 13, 2024 07:48
-
-
Save taniarascia/1aba40266c414814f06b0ec1c7597d87 to your computer and use it in GitHub Desktop.
Revisions
-
taniarascia revised this gist
Mar 20, 2019 . 1 changed file with 3 additions and 3 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -2,16 +2,16 @@ method1 = async () => { const things = await getThings() for (let thing of things) { const stuff = await getStuffFromThing(thing) console.log(stuff) // works } } method2 = async () => { const things = await getThings() await Promise.all(things.map(async thing => { const stuff = await getStuffFromThing(thing) console.log(stuff) // works })) } -
taniarascia created this gist
Mar 20, 2019 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,17 @@ method1 = async () => { const things = await getThings() for (let thing of things) { const stuff = getStuffFromThing(thing) console.log(stuff) // works } } method2 = async () => { const things = await getThings() await Promise.all(things.map(thing => { const stuff = getStuffFromThing(thing) console.log(stuff) // works })) }