Reputation: 2084
In this scenario
this.http.call().pipe(
catchError((error) => {
doSomething();
}),
switchMap((data) => {
doMoreThings();
}),
);
It's possible to not execute the switchMap when the catchError block is executed?
Upvotes: 1
Views: 63
Reputation: 96891
It depends on what Observable you return from catchError
's callback.
If you return empty()
. Then it won't trigger switchMap
because empty()
just completes and doesn't emit any next
notifications.
You can also return throwError(...)
that emits just an error
notifications and no next
's.
Upvotes: 1