@epikodelabs/streamix / merge
Function: merge()
merge<
T>(...sources):Stream<T>
Defined in: projects/libraries/streamix/src/lib/streams/merge.ts:18
Merges multiple source streams into a single stream, emitting values as they arrive from any source.
This is useful for combining data from multiple independent sources into a single, unified stream of events. Unlike zip, it does not wait for a value from every stream before emitting; it emits values on a first-come, first-served basis.
The merged stream completes only after all source streams have completed. If any source stream errors, the merged stream immediately errors.
Type Parameters
T
T = any
The type of the values in the streams.
Parameters
sources
...(Stream<T> | MaybePromise<T>)[]
Streams or values (including promises) to merge.
Returns
Stream<T>
A new stream that emits values from all input streams.