Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
26 lines (21 sloc) 501 Bytes
const { rxObserver } = require('api/v0.3');
const { from, timer } = require('rxjs');
const { delayWhen, timeout } = require('rxjs/operators');

const source$ = from([ 0, 10, 20, 45 ])
  .pipe(
    delayWhen(x => timer(x))
  );

const result$ = source$.pipe(
  timeout(20)
);

source$.subscribe(rxObserver());
result$.subscribe(rxObserver());
You can’t perform that action at this time.