DEV Community

Discussion on: What Even Is A Dispatch Function?

Collapse
 
kelviniot profile image
KelvinIOT • Edited

Hello Habib,

  • So i understand that Store holds the whole state tree of your application.
  • Then you pass to the store, your combineReducer which combines all your separate reducers in an object.
  • When the dispatch function calls the store, it actually tries all your Reducers.
  • But the Reducers listen for events checking for a matching action-type, so if the action-type passed to the dispatch finds a match in a reducer, that particular reducer runs.
Collapse
 
habibaman766 profile image
Habib Ur Rehman

Thank you very much for understanding.

Collapse
 
dustinmyers profile image
Dustin Myers

This is absolutely right! Sorry I was late on the reply. Hopefully kelvin's response helped you understand how this system works with combined reducers. Feel free to reach out if you have any other questions! And thank you Kelvin. That was a great explanation 👍👍