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

Creates a combined stream from source and other provided streams.
When source emits a value — resulting Observable will emit a combined value of source emission and all latest values on provided streams.

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


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

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

const result$ = a$.pipe(
  withLatestFrom(b$)
);

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