Actions
Actions are payloads of information that send data from your application to your store.
Action creators are functions that create actions. It's easy to conflate the terms “action” and “action creator,” so do your best to use the proper term.
Provided action creators
Redux REST Resource gives you ready-to-use action creators that will dispatch associated actions. Out of the box, you have the following actions configured:
You can check the default actions configuration
Available options
You can configure/override actions actions when using createResource
:
Every configuration can be specified at either a global level:
Or at the action level:
Fetch related options
Every option also accept a function that will receive the getState
helper, to act against the current state.
Every option can also be used at action call-time:
Reduce related options
Dispatched actions
We're using a dedicated status
field in our actions to reflect the Promise state.
For instance, fetchUsers()
will dispatch the following actions:
Every REST action creator will dispatch at most two actions based on the async status of the request.
Last updated