简体   繁体   English

Angular:forkJoin已弃用?

[英]Angular: forkJoin deprecated?

Today, I opened my Angular project and I found a warning saying: 今天,我打开了Angular项目,发现一条警告:

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

在此处输入图片说明

I googled it, but I found very little and I don't know how to get rid of the warning. 我用谷歌搜索,但是却发现很少,我也不知道该如何消除警告。 How do I have to use map instead of forkJoin ? 我如何使用map而不是forkJoin

forkJoin isn't deprecated. 不推荐使用forkJoin Only its variant with a result selector function is deprecated. 不推荐使用带有结果选择器功能的变量。

https://github.com/ReactiveX/rxjs/blob/master/src/internal/observable/forkJoin.ts#L29 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 https://github.com/ReactiveX/rxjs/blob/master/docs_app/content/guide/v6/migration.md#howto-result-selector-migration

So it should be like this: 所以应该是这样的:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM