English 中文(简体)
Redux - Data Flow
  • 时间:2024-11-03

Redux - Data Flow


Previous Page Next Page  

Redux follows the unidirectional data flow. It means that your apppcation data will follow in one-way binding data flow. As the apppcation grows & becomes complex, it is hard to reproduce issues and add new features if you have no control over the state of your apppcation.

Redux reduces the complexity of the code, by enforcing the restriction on how and when state update can happen. This way, managing updated states is easy. We already know about the restrictions as the three principles of Redux. Following diagram will help you understand Redux data flow better −

Data Flow

    An action is dispatched when a user interacts with the apppcation.

    The root reducer function is called with the current state and the dispatched action. The root reducer may spanide the task among smaller reducer functions, which ultimately returns a new state.

    The store notifies the view by executing their callback functions.

    The view can retrieve updated state and re-render again.

Advertisements