Named flatMap Operator on RxJS <= 4.X
const clicks$ = rxjs.fromEvent(document, 'click')
clicks$.pipe(rxjs.operators.mergeMap((ev) => rxjs.interval(1000)))
Maps each value to an Observable, then flattens all of these inner Observables using mergeAll
const clicks$ = rxjs.fromEvent(document, 'click')
clicks$.pipe(rxjs.operators.concatMap(
(ev) => rxjs.interval(1000)
.pipe(rxjs.operators.take(5)))
)
Maps each value to an Observable, then flattens all of these inner Observables using concatAll
const clicks$ = rxjs.fromEvent(document, 'click')
clicks$.pipe(
rxjs.operators.switchMap(
(ev) => rxjs.interval(1000).pipe(rxjs.operators.take(5))
)
)
Maps each value to an Observable, then flattens all of these inner Observables using switchAll || Map to observable, complete previous inner observable, emit values
const clicks$ = rxjs.fromEvent(document, 'click')
clicks$.pipe(rxjs.operators.exhaustMap(
(ev) => rxjs.interval(1000).pipe(rxjs.operators.take(5))
)
)
Maps each value to an Observable, then flattens all of these inner Observables using exhaust || Map to inner observable, ignore other values until that observable completes