// An observable that emits 10 multiples of 100 every 1 second const source$ = Observable.interval(1000) .take(10) .map(x => x * 100); /** * returns a promise that waits `ms` milliseconds and emits "done" */ function promiseDelay(ms) { return new Promise(resolve => { setTimeout(() => resolve('done'), ms); }); } // using it in a switchMap source$.switchMap(x => promiseDelay(x)) // works .subscribe(x => console.log(x)); source$.switchMap(promiseDelay) // just a little more terse .subscribe(x => console.log(x)); // or takeUntil source$.takeUntil(doAsyncThing('hi')) // totally works .subscribe(x => console.log(x)) // or weird stuff you want to do like Observable.of(promiseDelay(100), promiseDelay(10000)).mergeAll() .subscribe(x => console.log(x))