Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Claiming support for "asynchronous generators" creates confusion #538

Open
getify opened this issue Jun 7, 2020 · 0 comments
Open

Claiming support for "asynchronous generators" creates confusion #538

getify opened this issue Jun 7, 2020 · 0 comments

Comments

@getify
Copy link

getify commented Jun 7, 2020

The documentation has a section called "Asynchronous Generators", which I found while searching for native JS "stream" support. I was dismayed to see that this term is being used by Most in a way that's incompatible with how native JS behaves.

I found old issues (from 2017) about the topic of "async iteration" support (aka, JS's "asynchronous generators"), but didn't find anything since (sorry if I missed it).

The support for "generators that yield promises" is not the same thing as an "asynchronous generator", since the key difference is whether the .next() call on an iterator (attached to such a generator) returns Promise<IteratorResult> or whether it returns IteratorResult<Promise>.

The latter is what Most seems to support, but JS's asynchronous generators are the former interpretation.

I would suggest the documentation be updated to clarify, preferably by changing from "Asynchronous Generators" to "Promise-Producing Generators" or something like that. It'd be great if that section also noted this difference, to reduce future confusion.

Additionally, it'd be nice if Most re-visited the 2017 suggestion to roll actual JS async-generators support in. Back then it was a stage 3 proposal, but today it's been stable in JS for 2 years and has become the foundation of how all native DOM streams work. It'd be great to have Most support those directly, out of the box.

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

No branches or pull requests

1 participant