gpt4 book ai didi

Angular:不推荐使用 forkJoin?

转载 作者:行者123 更新时间:2023-12-03 17:06:34 26 4
gpt4 key购买 nike

今天,我打开我的 Angular 项目,发现一个警告说:

forkJoin is deprecated: resultSelector is deprecated, pipe to map instead (deprecation)

enter image description here

我用谷歌搜索了它,但我发现的很少,我不知道如何摆脱警告。我该如何使用 map而不是 forkJoin ?

最佳答案

forkJoin没有被弃用。仅弃用其带有结果选择器功能的变体。

https://github.com/ReactiveX/rxjs/blob/master/src/internal/observable/forkJoin.ts#L29

https://github.com/ReactiveX/rxjs/blob/master/docs_app/content/guide/v6/migration.md#howto-result-selector-migration

所以它应该是这样的:

forkJoin(a$, b$, c$).pipe(
map(x => resultSelector(...x))
)

关于Angular:不推荐使用 forkJoin?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54686934/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com