Today, I opened my Angular project and I found a warning saying:
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
?
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))
)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With