Last active
December 26, 2023 15:08
-
-
Save dtipson/97feb25f851f204ea74b5bb04b02ed92 to your computer and use it in GitHub Desktop.
An even simpler pipeline
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
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 | |
forEachAsyncGen(renderPost)// Promise of an array of numbers | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment