4 ms·
I'm a Redux maintainer. As I said over on Reddit when this was posted: The biggest issue is that it goes directly against the principles I listed in the Redux
by acemarke 6y ago
I'm a Redux maintainer. As I said over on Reddit when this was posted:
The biggest issue is that it goes directly against the principles I listed in the Redux Style Guide [0], particularly:
- put as much logic as possible in reducers [1]
- reducers should own the state shape [2]
- model actions as "events", not "setters" [3]
Also, Dan pointed out early on in Redux's development that "cursor"-style approaches to state updates are not how he intended people to use Redux [4].
Will it run? Sure. Is it something I'd actually recommend? Definitely not, and especially given the existence of our official Redux Toolkit package [5] and the React-Redux hooks API [6].
[0] https://redux.js.org/style-guide/style-guide https://redux.js.org/style-guide/style-guide
[1] https://redux.js.org/style-guide/style-guide#put-as-much-logic-as-possible-in-reducers https://redux.js.org/style-guide/style-guide#put-as-much-log...
[2] https://redux.js.org/style-guide/style-guide#reducers-should-own-the-state-shape https://redux.js.org/style-guide/style-guide#reducers-should...
[3] https://redux.js.org/style-guide/style-guide#model-actions-as-events-not-setters https://redux.js.org/style-guide/style-guide#model-actions-a...
[4] https://github.com/reactjs/redux/issues/155#issuecomment-113951420 https://github.com/reactjs/redux/issues/155#issuecomment-113...
[5] https://redux-toolkit.js.org https://redux-toolkit.js.org
[6] https://react-redux.js.org/api/hooks https://react-redux.js.org/api/hooks