|
|
|
|
|
by munchbunny
2374 days ago
|
|
Not in a substantial way. The boilerplate is a consequence of the functional “workaround”: representing a mutation as the result of applying a state transition to a complex state, and then computing what to display as a function of both the current and previous states. The way to reduce the boilerplate is to use a mutable paradigm, but then you lose the simplifications that the immutable paradigm gives you. |
|
We recommend using Immer as the best way to write immutable logic with Redux [1], and our new Redux Toolkit package [2] automatically uses Immer internally to let you write reducers like this:
[0] https://immerjs.github.io/immer/[1] https://redux.js.org/style-guide/style-guide/#use-immer-for-...
[2] https://redux-toolkit.js.org