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

Suggestion: update docs to indicate "async generators" support #703

Open
getify opened this issue Jun 7, 2020 · 1 comment
Open

Suggestion: update docs to indicate "async generators" support #703

getify opened this issue Jun 7, 2020 · 1 comment

Comments

@getify
Copy link

getify commented Jun 7, 2020

I found Highland while searching for stream library support for native JS async generators (like async function *main(..) { .. }) and thus async-iteration. It seems from looking at the code and previous commits that these are supported when passing to the _(..) stream constructor, but the docs don't really make that clear.

The docs mention support for "Iterator" (from normal generators), but not "AsyncIterator"... that is, where the .next(..) call returns Promise<IteratorResult>.

I would suggest including mention of this support, including code examples, to reduce future confusion.

@maxdumas
Copy link

Is this true? It makes sense that this would be the case, and either way I imagine it would be trivial to support. As a TypeScript user, it would be great if the Typescript bindings supported an AsyncIterable as input, so that we could maintain good generics that we lose if using Readable.from.

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

2 participants