Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Angular: forkJoin deprecated?

Tags:

angular

rxjs

Today, I opened my Angular project and I found a warning saying:

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

enter image description here

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?

like image 965
amedina Avatar asked Feb 14 '19 09:02

amedina


1 Answers

forkJoin isn't deprecated. 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/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))
)
like image 174
martin Avatar answered Nov 17 '22 05:11

martin