exhaustMap
Introduction
Section titled “Introduction”exhaustMap ignores new outer emissions while the current inner Observable is active. Perfect for preventing double submissions.
Example
Section titled “Example”submitClicks$.pipe( exhaustMap(() => this.http.post('/api/submit', data)) // Second click is ignored while request is in flight).subscribe();When to Use
Section titled “When to Use”- Login/Submit buttons (prevent double-clicks)
- Token refresh (don’t refresh while already refreshing)
Summary
Section titled “Summary”exhaustMap prevents duplicate concurrent operations.”