Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
32 lines (24 sloc) 841 Bytes

Creates Observable from multiple Observables.
Resulting stream will emit a combined value of all latest emissions of input streams

const { rxObserver } = require('api/v0.3');
const { timer, combineLatest } = require('rxjs');
const { take } = require('rxjs/operators');


const a$ = timer(0, 10).pipe(
    take(5)
  );

const b$ = timer(0, 4).pipe(
    take(7)
  );

const result$ = combineLatest(a$, b$);

a$.subscribe(rxObserver('a$'));
b$.subscribe(rxObserver('b$'));
result$.subscribe(rxObserver('combineLatest(a$, b$)'));
You can’t perform that action at this time.