在我拥有这个运行良好的解析器之前:
resolve() {
return forkJoin(
this.getData1(),
this.getData2(),
this.getData3()
);
}
现在我必须做一些实际上行不通的事情:
resolve() {
return this.actions$
.pipe(
ofActionSuccessful(SomeSctonSuccess),
forkJoin(
this.getData1(),
this.getData2(),
this.getData3()
)
);
}
当我遇到这个错误时:
“Observable”类型的参数不可分配
到“OperatorFunction”类型的参数。类型
'Observable' 未提供签名匹配
'(来源:Observable):Observable'。
有什么想法如何修复吗?
现在我需要归还我的forkJoin
仅在那之后ofActionSuccessful(SomeSctonSuccess)
正在发生https://ngxs.gitbook.io/ngxs/advanced/action-handlers
Use exhaustMap
操作员。它映射到内部可观察量,忽略其他值,直到该可观察量完成
import { forkJoin } from 'rxjs';
import { exhaustMap } from 'rxjs/operators';
resolve() {
return this.actions$
.pipe(
ofActionSuccessful(SomeSctonSuccess),
exhaustMap(() => {
return forkJoin(
this.getData1(),
this.getData2(),
this.getData3()
)
})
);
}
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)