3 ms·
I just converted one of our medium sized redux apps to immer and it has been a resounding success. I highly recommend it and will be using it everywhere in the
by pault 8y ago
I just converted one of our medium sized redux apps to immer and it has been a resounding success. I highly recommend it and will be using it everywhere in the future.
- acemarke 8y agoHi, I'm a Redux maintainer. I'd be interested in hearing how your experience with Immer went, as well as any other feedback you can offer. Also, as I mentioned just below, please try out our new Redux Starter Kit package, which uses Immer internally (and offers several other useful utilities for simplifying common Redux use cases, like store setup, reducer definitions, and even creating entire "slices" of state at once): https://redux-starter-kit.js.org https://redux-starter-kit.js.org
- pault 8y agoActually the reason I was willing to take a chance on Immer is because it's included in redux starter kit. :) Using immer in production has been about 1000x better than writing immutable state updates by hand. It literally reduced (hah) the LOC in our reducers by at least 75%, not to mention the gains from reduced cognitive overhead. The architecture I ended up using is basically a recreation of redux starter kit with some customization for convenience (a couple of methods on action creators that wrap `toString` for creating reducer keys that only handle actions with certain meta properties, like `updateEntities.of(entity)`).
- acemarke 8y agoNeat! I'd be interested in seeing what you came up with if you get a chance.
- chrisparton1991 8y agoI rewrote my reducers with Immer as well. I had some pretty complex nested updates that became super simple with Immer, love it!