我有几个异步运行的动作,比如说VerifyEmail
和changepassword
. 我想在动作开始时显示一个加载器,并在拍卖结束时隐藏它。我知道我可以通过这种方式为每个动作做到这一点:
this.actions$
.pipe( ofActionDispatched(VerifyEmail) )
.subscribe( () => {
this.showLoader();
});
this.actions$
.pipe( ofActionSuccessful(VerifyEmail) )
.subscribe( () => {
this.hideLoader();
});
但是每个异步操作都有两个块,我想知道是否有办法将多个操作组合到一个管道中?像ofActionDispatched([VerifyEmail, ChangePassword])
什么?