rxjs condition inside flatmap
问题 I want to have a condition inside flatMap that checks what was returned by first observable. If condition is not met I would like to break and navigate to different page. this.service.getData(id) .flatMap((data) => { if (!data) { return Observable.throw(new NoDataFoundError()); } return Observable.forkJoin( this.service.getData2(id2), this.service.getData3(id3), ); }) .subscribe( ([data2, data3]) => { this.data2= data2; this.data3= data3; }, (err) => { if (err instanceof NoDataFoundError) {