Worried about pluck operator deprecation #7108
-
I stumbled over an use case, in which the pluck operator has advantages over the map with optional chaining equivalent. In case you use a dynamic property key and not a string as the pluck function parameter, you can't catch that nicely with optional chaining. Super basic example:
compared to
For me the deprecation of the pluck operator would mean a loss, especially when working with deeply nested data structures and you maybe do not even know which property key names come along. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
If you feel to keep it in your codebase, you can create custom operator anytime. The main reasoning to revisit core api surface is we are trying to balance around surfaces of api itself, and triviality of implementation, and usecases including potential userbase who relies on it. |
Beta Was this translation helpful? Give feedback.
pluck
is a variant ofmap
operator less than 10 lines:rxjs/src/internal/operators/pluck.ts
Lines 94 to 104 in afac3d5