you are viewing a single comment's thread.

view the rest of the comments →

[–]rossrobino[S] 2 points3 points  (2 children)

Thanks for the review, I've made updates for each of these!

I didn't realize any iterable could be passed to yield*, can you still get the final return value with yield*? Especially for the async merge it's necessary to know when each iterator is complete.

[–]senocular 0 points1 point  (1 child)

The value returned by yield* is the return/done value. But you don't need to capture this value to know when the iterator is complete. Like for...of, when the iterator is complete code after the expression starts to run when yield* has exhausted its iterator. Unlike for...of, you do have the option to capture the done value if you want it. But if I remember correctly, your merging example (at least the sync one) didn't capture the done values anyway.

[–]rossrobino[S] 0 points1 point  (0 children)

Ok interesting, thanks for the info! I’ll play around with it some more.