【发布时间】:2021-05-17 23:44:57
【问题描述】:
这是我想要实现的目标:
this.jobManager
.queue(
// start a job
)
.then(
// do more stuff, but abort if `ABORT` action dispatched before it finishes
)
.finally(
// still do some cleanup even if `ABORT` dispatched
);
这是我“尝试过”的:
this.actions$.pipe(
ofActionDispatched(ABORT)
.subscribe(() => {
// somehow interrupt the promise chain in the above code block...
})
);
希望我已经充分传达了所需的逻辑。我认为这两者需要组合成一个单一的承诺链,但我不确定如何做到这一点。
【问题讨论】:
标签: javascript angular rxjs5