4 ms·
Oh, I see, Redux also requires Immutable.js to work, correct?
by iliaznk 11y ago
Oh, I see, Redux also requires Immutable.js to work, correct?
- vkjv 11y agoReduce requires that functions be pure (no side effects). Immutable.js is one way to enforce this but ithe is not required. The examples mostly use things like the spread operator and Object.assign.
- acemarke 11y agoNope. Redux does require that your reducers update their state immutably, but does not care HOW you do so. You can do it with Object.assign() / _.extend(), array slicing, the object spread operator, Immutable.js, the React Immutability Helpers, or one of the umpteen libs that provide abstractions for immutable updates like dot-prop-immutable or object-immutable-path.