3 ms·
Yep, and as I've said numerous times [0] [1]: you can use as much or as little abstraction on top of Redux as you want. Don't like writing action constants by
by acemarke 9y ago
Yep, and as I've said numerous times [0] [1]: you can use as much or as little abstraction on top of Redux as you want. Don't like writing action constants by hand? Use `redux-actions` to generate action creators that have an overriden `toString()`. Don't like touching multiple files? Use the "ducks" pattern. Want something that adds additional layers on top so you don't even have to touch the store? Use Kea or Jumpstate or Dva.
Also, my own personal advice is that you should always use the "object shorthand" version of `mapDispatch`, and never actually write a real `mapDispatch` function by hand again:
const actions = {addTodo, toggleTodo};
export default connect(mapState, actions)(TodoList);
[0] http://blog.isquaredsoftware.com/2017/05/idiomatic-redux-tao-of-redux-part-2/ http://blog.isquaredsoftware.com/2017/05/idiomatic-redux-tao...
[1] https://github.com/reactjs/redux/issues/2295 https://github.com/reactjs/redux/issues/2295