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.
import { reset } from 'redux-resource-plugins';
import store from './store';
// Reset just the "createBook" request
store.dispatch(reset.resetResource('books', {
requestKey: 'createBook'
}));
// Reset just the "favorites" list
store.dispatch(reset.resetResource('books', {
list: 'favorites'
}));
// Reset a list and a request at the same time
store.dispatch(reset.resetResource('books', {
list: 'favorites',
requestKey: 'readFavorites'
}));