An action creator is, quite simply, a function that creates an action. Do not confuse the two terms—again, an action is a payload of information, and an action creator is a factory that creates an action.
Calling an action creator only produces an action, but does not dispatch
it. You need to call the store's dispatch
function to actually cause the
mutation. Sometimes we say bound action creators to mean functions that
call an action creator and immediately dispatch its result to a specific
store instance.
If an action creator needs to read the current state, perform an API call, or cause a side effect, like a routing transition, it should return an async action instead of an action.
Generated using TypeDoc
Returned action type.