Skip to content

Conversation

monitorjbl
Copy link

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.

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.
Copy link
Owner

@enisdenjo enisdenjo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

@monitorjbl
Copy link
Author

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

@monitorjbl
Copy link
Author

Any other feedback, or is this good to merge?

Copy link
Owner

@enisdenjo enisdenjo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the delay, this is looking good. Let's wait for the CI to pass and merge. Thank you for your support!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants