Star

Created With


combine



Combines data from multiple sources and emits as an array:

1linkfunction combine<A, B>(a: Source<A>, b: Source<B>): Source<[A, B]>

1linkimport { interval, pipe, subscribe, combine, map } from 'callbag-common';

2link

3linkpipe(

4link combine(interval(500), interval(1000)),

5link subscribe(console.log)

6link)

[0, 0] [1, 0] [2, 0] [2, 1] [3, 1] [4, 1] [4, 2] [5, 2] [6, 2] [6, 3] ...
► Try It!

👉 Waits until all sources have emitted at least once.

👉 After that, will emit every time any source emits, combining latest emissions into an array.

👉 Can be called with any number of sources.




Home What Are Callbags?

Source Factorieschevron_right
Operatorschevron_right
Combinationchevron_right
Utilitieschevron_right