switchMap vs mergeMap
Updated May 6, 2026
Short answer
switchMap cancels previous; mergeMap runs all concurrently.
Deep explanation
switchMap is ideal for latest-only requests.
Real-world example
Search autocomplete API calls.
Common mistakes
- Using mergeMap when cancellation is needed.
Follow-up questions
- What is concatMap?
- Which is fastest?