Redux description of each object

 

store

store is a data warehouse, an application store is unique, it encapsulates the state inside the state, when the user wants to access state, the state can only be achieved through an object store.getState, and the object is made of a store snapshots, this put the store objects protected.

action

action describes the action of an updated state, it is an object that must be some type attribute, which specifies the value of an action and you want to modify:

{type: UPDATE_TITLE_COLOR, payload: 'green'} 

actionCreator

Are written every time you distribute action on long action object is not very convenient, but actionCreator is to create a method action object, you can call this method returns an action object is to simplify the code.

dispatch

dispatch is a method, which is used to distribute an action action, this is the only one able to modify the state of the method, it will call reducer inside to call different logic based on the old state to update a new state.

reducer

reducer is the core of the update state, which it encapsulates the logic state of the update, reducer provided by the external (encapsulate business logic, passed in the createStore), and pass the old state objects and action, the new value is updated to the old state objects on return.

Guess you like

Origin www.cnblogs.com/yangjingyang/p/11595534.html