
上QQ阅读APP看书,第一时间看更新
An action is dispatched
It all starts with a call to store.dispatch(action), which means that some action happened (user action, request resolved, and so on). An action is a plain object that describes what happened:
{ type: 'CREATE_POST', user: 'dan', text: 'hello world' }
It might help to think of the action as a kind of a log entry that tells we what happened, for example, Post hello world created by user dan.
Redux checks whether the dispatched action has a type property, then passes it on to the main reducer. This process is called dispatching an action.