I am new to react/redux. I am trying to figure out how all the pieces in redux interact. The one thing giving me trouble is understanding the relation between actions and reducers. When an action is called, how does the store know which reducer to use? Does it base it completely on the action type name? Do type names have to be unique? To whom or what does the reducer pass the new state object to, the store or the action?
As I understand it, it goes like this:
- store.dispatch(action) is called
- store finds the related reducer based on action type
- Reducer clones the current state object, makes the changes, passes it back (somewhere)