DEV Community

Discussion on: Immer vs Ramda - two approaches towards writing Redux reducers

Collapse
 
antonmelnyk profile image
Anton Melnyk • Edited

Nice article. For me, Ramda is an obvious choice. Immer destroys the whole purpose of Redux and the functional way to handle data logic. It makes simple immutability and "todo"-like reducers look easy, but for complex applications where Redux shines, it won't bring that much benefit. Moreover, the explicitness and clean code is the point of FP - Immer hides it underneath, covering what is actually happening in reducers.

Ramda is a much more scalable and clean support library for Redux and is a bummer Immer is perceived as default approach in Redux toolkit. Ramda embraces FP - Immer tries to hide it under the cover.

Collapse
 
fkrasnowski profile image
Franciszek Krasnowski

I’ve got similar impressions. Immer is enjoyable if it comes to simple reducers managing some simple/local states; however, Redux is designed to work well with huge apps, where state and its mutations can be very hard to track. Still, many devs use Redux with simple apps. I think Redux Toolkit aims to reduce this gap between use cases and make Redux approachable in those simple scenarios