Skip to content

Claiming support for "asynchronous generators" creates confusion #538

@getify

Description

@getify

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions