BACK
ReferenceexhaustMap
Reference · 24

exhaustMap

exhaustMap

rxjs.dev

Ignores new values until the inner stream completes.

Signature

exhaustMap(project): OperatorFunction

Marble diagram

outer:    a-b-c----d--|
inner(a): --1-2-3|
result:   --1-2-3----d?-|

What it does

The first outer value starts the inner. Every later value that arrives before that inner completes is dropped. After complete, it's ready for the next one again.

When to use

Double-submit protection, form submission, login, any "one-shot until it finishes" action. No need to manually disable the button.

See also

switchMap, concatMap, throttleTime

script.ts // TypeScript
CONSOLE · Console output
Hit Run to see the result...