reducers
Reducers are triggered by actions, and are the only way to modify the state. Let's see which reducers exist, and their effect on the state.
REQUEST
Will add metadata corresponding to the normalized URL to the state.
RECEIVE
Will set the metadata to a success state, and store the resource.
FAIL
Will set the metadata to a an error state. payloadIds
will remain unchanged.
RECEIVE_FROM_CACHE
When requesting a couple of resource/id which is already in state and cache is still fresh, the request will be stored in a success state with the property fromCache
to true.
INVALIDATE_RESOURCE
Will set didInvalidate
to true for each request related to the resource.
INVALIDATE_ID
Will set didInvalidate
to true for each request related to the resource/id.
INVALIDATE_REQUEST
Will set didInvalidate
to true for the related request.
RESET_RESOURCE
Will remove the resource and related requests from the state.
RESET_ALL
Will empty the state completely.
Last updated