@epikodelabs/streamix / eachValueFrom
Function: eachValueFrom()
eachValueFrom<
T>(stream):AsyncGenerator<T>
Defined in: projects/libraries/streamix/src/lib/converters/eachValueFrom.ts:19
Converts a Stream into an async generator, yielding each emitted value.
Dropped results (internal backpressure signals from filter/skip/debounce etc.) are filtered out transparently — only real emissions are yielded, so consumers using for await...of eachValueFrom(stream) never see dropped values.
The generator handles all stream events:
- Each yielded value corresponds to a real
nextemission, including undefined. - The generator terminates when the stream
completes. - It throws an error if the stream emits an
errorevent.
Type Parameters
T
T = any
The type of the values emitted by the stream.
Parameters
stream
Stream<T>
The source stream to convert.
Returns
AsyncGenerator<T>
An async generator that yields the non-dropped values from the stream.