Angular:不推荐使用 forkJoin?

ame*_*ina 8 rxjs angular

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

forkJoin is deprecated: resultSelector is deprecated, pipe to map instead (deprecation)
Run Code Online (Sandbox Code Playgroud)

在此处输入图片说明

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

mar*_*tin 8

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))
)
Run Code Online (Sandbox Code Playgroud)