5 ms·
A good starting point to explaining reducers is that you are reducing two things into one. A redux reducer: The action and the current state reduce into the ne
by howlinbash 6y ago
A good starting point to explaining reducers is that you are reducing two things into one.
A redux reducer:
The action and the current state reduce into the new state.
And of course it doesn't matter how many reducers or combined reducers your state uses - they're all ultimately just doing this.
This also works for Array.prototype.reduce(). You're reducing two things into one.
- rlt 6y agoThe concept of a reducer isn’t the hard part of Redux... it’s designing your state, organizing actions/reducers/selectors, reducing (no pun intended...) boilerplate, dealing with side effects and asynchrony, etc.