Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.



The 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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: