Last active
December 26, 2023 15:08
-
-
Save dtipson/97feb25f851f204ea74b5bb04b02ed92 to your computer and use it in GitHub Desktop.
Revisions
-
dtipson revised this gist
Dec 26, 2023 . 1 changed file with 1 addition and 1 deletion.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 @@ -1,5 +1,5 @@ const outputs = await pipe( postIds,// array of numbers, which is... already an iterable mapGen(fetchById),// generator of an array of eventually all resolved promises (requested in chunks of 3) chunkGen(5),// generator of arrays of 5 promises, our "batch" spreadBatchesAsyncGen,// async generator of individual resolved promises -
dtipson created this gist
Dec 26, 2023 .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,7 @@ const outputs = await pipe( testArrayGen,// generator of numbers mapGen(fetchById),// generator of an array of eventually all resolved promises (requested in chunks of 3) chunkGen(5),// generator of arrays of 5 promises, our "batch" spreadBatchesAsyncGen,// async generator of individual resolved promises forEachAsyncGen(renderPost)// Promise of an array of numbers )