@epikodelabs/streamix / from
Function: from()
from<
T>(source):Stream<T>
Defined in: projects/libraries/streamix/src/lib/streams/from.ts:15
Creates a stream from an asynchronous or synchronous iterable.
This operator is a powerful way to convert any source that can be iterated over (such as arrays, strings, Map, Set, AsyncGenerator, etc.) into a reactive stream. The stream will emit each value from the source in order before completing.
Type Parameters
T
T = any
The type of the values in the iterable.
Parameters
source
MaybePromise<AsyncIterable<T> | Iterable<T>>
The iterable source to convert into a stream.
Returns
Stream<T>
A new stream that emits each value from the source.