我有一系列类似这样的可观察对象:
this.subscription = combineLatest(
[1$, ..., m$]
).pipe(
filter((latest: [boolean, ..., number]) => {
const [1, ..., m] = latest;
const shouldContinue: boolean = <some logic>;
return shouldContinue;
}),
concatMap((latest: [boolean, ..., number]) => {
const [1, ..., m] = latest;
// Hits here first time, then never again
return <method that returns an Observable>().pipe(concatMap((result: [boolean, ..., number]) => {
const [2, ..., n] = result;
// Hits here first time, then never again
return <another method that returns an Observable>();
}));
})
).subscribe((result: [boolean, ..., number]) => {
const [3, ..., o] = result;
// Hits here first time, then never again
<some method>();
});
第一次将shouldContinue
设置为true
时,其余函数将一直被调用到订阅中。
但是第二次将shouldContinue
设置为true
(我可以在调试器中看到它的设置),代码再也不会移入concatMap
中了。
我在这里想念什么?