Skip to content

exhaustMap

exhaustMap ignores new outer emissions while the current inner Observable is active. Perfect for preventing double submissions.

submitClicks$.pipe(
exhaustMap(() => this.http.post('/api/submit', data))
// Second click is ignored while request is in flight
).subscribe();
  • Login/Submit buttons (prevent double-clicks)
  • Token refresh (don’t refresh while already refreshing)

exhaustMap prevents duplicate concurrent operations.”