Beta (still building)

exhaustMap

exhaustMap operator is merging of exhaust + map.

it projects each source value to an Observable, while before Observable streaming is finished

the projected observable should be finished, otherwise it will not emit the next projected observable.

Example: exhaustMap operator

you can see if previous observable isn't finished, will ignore next emit sequence.

import { timer, interval } from 'rxjs';
import { exhaustMap, map, take } from 'rxjs/operators';

const projection$ = interval(500).pipe(take(6));
const source$ = timer(0, 2000).pipe(take(4));

const result$ = source$.pipe(
  exhaustMap ((i) => projection$),
  // equivalen "exhaust" + "map":
  // pipe(map((i) => projection$), exhaust())
);

Example: ⚠️ wrong use ⚠️

the projected observable should be finished

import { timer, interval } from 'rxjs';
import { exhaustMap, map, take } from 'rxjs/operators';

const projection$ = interval(1000) // should be finished 
const source$ = timer(0, 2000).pipe(take(4));

const result$ = source$.pipe(exhaustMap ((i) => projection$));

Official Doc: rxjs.exhaustMap