Hacker News new | ask | show | jobs
by koolba 1055 days ago
What’s the alternative for functional transforms in redux selectors?
3 comments

I like immer for this kind of thing: https://github.com/immerjs/immer

You can do immutable transformations without getting bogged down in FP abstractions.

If you use something like redux toolkit query, it already abstracts that for you using Immer internally. You can just write a simple arrow function or use lodash or underscore or whatever pleases you.

https://redux-toolkit.js.org/usage/immer-reducers

I have used lodash/fp successfully in Javascript projects at current and previous job. Not sure about the TypeScript support.