Which RxJS operator cancels the previous inner observable when a new value arrives?
- A mergeMap
- B concatMap
- C switchMap
- D exhaustMap
Answer
switchMap
switchMap is ideal for type-ahead search because it cancels the in-flight request. It is dangerous for save operations, which should not be cancelled.





