1. What is the Redux
Redux is an important part of React ecology. Many people say, you can not apply this simple tool. But I personally think that the use of small and medium sized applications, you can make more standardized file structure, the code more readable. React proposed as display assembly and the container assembly separated from the idea of the degree of coupling is reduced between React and Redux.
Redux is a popular JavaScript framework, providing a predictable state of the container application. Redux framework based on a simplified version of Flux, Flux is a framework developed by Facebook. In the MVC standard framework, data can flow bidirectionally between the storage and the UI component, and Redux restricted data flow in one direction only. See below:
In Redux, all data (for example state) is stored in a referred store
→ a container in only one application. store
It is essentially a state tree, save the state of all objects. Any UI components directly from the store
state to access a particular object. To change the status by local or remote components, you need to distribute a action
. Distribution here means that information is sent to the executable store
. When a store
received one action
, this willaction