3 ms·
Yeah. I love Redux and will happily promote it, but it's not for everyone, and there's definitely people out there who insist you _have_ to use it. My own adv
by acemarke 9y ago
Yeah. I love Redux and will happily promote it, but it's not for everyone, and there's definitely people out there who insist you _have_ to use it. My own advice for getting started with React is to focus on React first, then learn Redux later.
The "single generic reducer" approach is technically valid, and I've seen several articles where people do that. I discourage that approach because it doesn't tell you anything meaningful about the _intent_ behind the update, and it's much harder to trace where that action was dispatched, but it's a legal way to use Redux. My two "Tao of Redux" posts discussed the intent behind state changes being semantically meaningful, and both my own thoughts and Dan Abramov's comments on the "all-in-one reducer" approach [0] [1].
(Also, I should look at who I'm replying to before I write answers. Hi, Shados!)
[0] http://blog.isquaredsoftware.com/2017/05/idiomatic-redux-tao-of-redux-part-1/#action-history-should-have-semantic-meaning http://blog.isquaredsoftware.com/2017/05/idiomatic-redux-tao...
[1] http://blog.isquaredsoftware.com/2017/05/idiomatic-redux-tao-of-redux-part-2/#cursors-and-all-in-one-reducers http://blog.isquaredsoftware.com/2017/05/idiomatic-redux-tao...