Update example to remove AsyncGenerator (#654)#655
Update example to remove AsyncGenerator (#654)#655monitorjbl wants to merge 2 commits intoenisdenjo:masterfrom
Conversation
AsyncGenerators are not safe to use outside of toy examples. The `next()` function will block any call to `return()` or `throw()` if it is waiting on a promise. To avoid this pitfall, implementations should not use the native `async function*()` syntax and should instead provide their own `AsyncIterator` implementations.
enisdenjo
left a comment
There was a problem hiding this comment.
Thanks for working on this! However, I feel like the 50 lines of EventProvider for the getting started is too much. I instead recommend using RepeaterJS here.
If you want to talk about the asyngenerator quirks, maybe add it somewhere else? A new page? Recipes?
Sure, moved the longer explanation to recipes and made the getting started example use Repeater.js |
|
Any other feedback, or is this good to merge? |
enisdenjo
left a comment
There was a problem hiding this comment.
Sorry for the delay, this is looking good. Let's wait for the CI to pass and merge. Thank you for your support!
AsyncGenerators are not safe to use outside of toy examples. The
next()function will block any call toreturn()orthrow()if it is waiting on a promise. To avoid this pitfall, implementations should not use the nativeasync function*()syntax and should instead provide their ownAsyncIteratorimplementations.