Html & Html5

The World's best Software Development Study Portal

Redux Data Flow

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

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 −

This diagram shows unidirectional redux data flow.As we have discussed earlier,Redux is a state management system. Therefore, we will need a place to save the state,a method to get the state and a method to change the state. And this is what we do when using Redux:

1.store is the place we save the state
2.getState is the method to get the state
3.action & reducer is the method to change the mapStateToProps.

The part we need to explain more will be action and reducer. Redux update the state through action and reducer. The action tell reducer what does it want to do. Then the reducer updates the state base on the type and additional data provided by action.