Skip to content

@epikodelabs/streamix


@epikodelabs/streamix / src/public-api / eachValueFrom

Function: eachValueFrom() ​

eachValueFrom<T>(stream): AsyncGenerator<T>

Defined in: projects/libraries/streamix/src/lib/converters/eachValueFrom.ts:15

Converts a Stream into an async generator, yielding each emitted value.

The generator handles all stream events:

  • Each yielded value corresponds to a real next emission, including undefined.
  • The generator terminates when the stream completes.
  • It throws an error if the stream emits an error event.

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 values from the stream.

Released under the GNU AGPL v3 or later.