Async iterators should work in flatMap
MichalCz opened this issue · 2 comments
MichalCz commented
Is your feature request related to a problem? Please describe.
flatMap
is a powerfull function, but should support async iteration.
There may be additional methods needing this.
Describe the solution you'd like
This simple example should not error:
DataStream.from(generator1)
.flatMap(async function*(chunk) { yield* await chunk.items(); })
MichalCz commented
- Methods needing attention:
flatMap
,flatten
(onDataStream<AsyncIterator>
),join
- Additionally pretty much all of
MultiStream
should be reviewed to work with iterators. - Docs need to be updated - add more about generators.
- Primary example on webpage and in repo should be updated with generators.
MichalCz commented
Yup. Now works.