The 2nd concatMap
does not get called.
this.apiService.get()
.pipe(
concatMap((data: MyModel) => {
if (data) {
// the following returns a MyModel Observable
return this.apiService.update(data);
} else {
return empty();
}
}),
concatMap((data: MyModel) => this.apiService.update(this.myOtherData))
)
.subscribe(data => log('completed'));
any ideas?
You'd have to double pipe. Take a look here: https://github.com/reactivex/rxjs/issues/4071
You know how concatMap requires an observable to return? Well I just learned that if there is an issue with that source observable concatMap won't fire. I was stumped trying to troubleshoot concatMap when it wasn't the cause.
This is how I troubleshot it too, by sending an empty observable to make sure my setup was correct.