@epikodelabs/streamix / src/public-api / concat
Function: concat()
concat<
T>(...sources):Atom<T>
Defined in: projects/libraries/streamix/src/lib/factories/concat.ts:23
Concatenates sources sequentially.
concat(a, b, c) subscribes to a, yields all its values, waits for it to complete, then moves to b, then c.
- If any source errors, the concatenated atom errors and remaining sources are not processed.
- Sources may be atoms, streams, raw values, arrays/iterables, or Promises of those.
Type Parameters
T
T = any
Value type.
Parameters
sources
...PipeInput<T>[]
Atoms, streams, or values (including promises) to concatenate.
Returns
Atom<T>
A new atom that emits values from all input sources in order.
Example
ts
const s = concat(from([1, 2]), from([3]), 4);
// emits: 1, 2, 3, 4