4 ms·
Today for my React state management I use just a plain vanilla JS class (ES2015, to be precice). I have immutable state and PureComponent classes, like all the
by kozak 8y ago
Today for my React state management I use just a plain vanilla JS class (ES2015, to be precice). I have immutable state and PureComponent classes, like all the cool guys. I could, in principle, maintain the immutable state myself using a lot of Object.assign() calls, but there is a nice little library called "icepick" that does it for you. The library is just a set of pure functions that return standard JavaScript frozen objects.
This way I have all the advantages of Redux, but with very terse BS-free code.