Learn how to build a reasonable approximation of the combineReducers() utility in 15 lines. No magic!
I love that you explained what
combineReducers does long-hand (writing it out explicitly) in the last video before introducing it here. That took the magic out of it and made it really easy to understand what's going on. Kudos!
Great explanation, great content!
That was so meta, it made me go
Am I correct in saying the following:
Every event is dispatched to all of the reducers in combined reducers. If the action.type doesn't exist in the reducer it doesn't happen.
If I wanted to have two different things happen with the same action, I can have to separate updates happen to the state. Let's say I am rolling the dice and tracking all rolls of the dice, I might keep a currentRoll running for display and a rollHistory for a fairness tracker. Since all actions pass through all reducers, I don't need to worry about managing which reducer is getting the action.
The more I look at this the more brilliant it is. The problem is attempting to pass it on to the next person.
That is me attempting to say that communicating programming ideas to programmers can be challenging. Trying to communicate programming ideas to non programmers and have them actually hear what you said... That is how folks end up needing medication.
noticed that using
combineReducers “from scratch” vs redux has a slight observable difference:
store.createStore( todoApp );calls each reducer again, once
why is that?
This (and this entire lesson) is really very good, thank you!