I have below code:
subscriber.pipe(
switchMap(data => {
this.getData().pipe(
map(() => res),
catchError(error => {
return of(null);
})
);
}),
switchMap(data => {
})
).subscribe();
In case of error in first switchMap i am returning of(null) so next switchMap is reciving data as null. But i like to stop the execution in case first switchMap goes to catchError block, it should not execute second switchMap. Is there a way to achieve this?