Reset
The reset plugin allows you to remove all of the data in a slice, effectively "resetting" it. You may optionally scope the resetting to affect a single list or request object.
Usage
First, you need to register this plugin for any slice that needs it.
Then, you can use the action creator that ships with the plugin to perform the reset.
Resetting a slice will leave you with the following state:
Resetting a list will set the list to be an empty array.
The additional initial state that you pass to resourceReducer
will also be included when you reset your state.
You can pass a second argument, options
, to scope what is reset:
resetResource(resourceType, [options])
resetResource(resourceType, [options])
Resets the slice for resourceType
. Pass options
to scope what's reset. There are two valid options:
requestKey
: Reset the request with this keylist
: Reset the list with this name
Arguments
resourceType
(String): The name of the slice to reset.[
options
] (String): Options to scope what is reset.
Returns
(Object
): A Redux action to be dispatched.
Last updated