Add Additional Information for Redux-Persist
See original GitHub issueI was working on a project where I implemented RTK with redux-persist following the docs for RTK but I wanted to ‘flush’ storage on user logout which seems to be a fairly common action and it wasn’t immediately apparent how to accomplish this with RTK based on current documentation. Here was the final solution:
import { PURGE } from "redux-persist";
...
extraReducers: (builder) => {
builder.addCase(PURGE, (state) => {
customEntityAdapter.removeAll(state);
});
}
Can I open a PR for this addition to the docs?
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
Persist state with Redux Persist using Redux Toolkit in React
Persisting state with Redux Persist. First, we'll add Redux Persist to our app with the following command: $ npm i redux-persist.
Read more >rt2zz/redux-persist: persist and rehydrate a redux store - GitHub
Redux persist ships with react integration as a convenience. The PersistGate component is the recommended way to delay rendering until persistence is complete....
Read more >The Definitive Guide to Redux Persist - React Native Coach
Persist your Redux state in between app launches with Redux Persist ... Redux Persist takes your Redux state object and saves it to...
Read more >How to Persist Your Redux Store - How-To Geek
Redux Persist is a popular library which lets you add persistence to the store. The library will automatically save the store each time...
Read more >Redux-Persist: How it Works and How to Change the Structure ...
Redux persist is a library allowing to save the redux store in the local storage of your browser. But, using redux-persist and changing...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Always 😃
Well at least one thing is certain, RTK is an awesome product!
I would be more than happy to add it to the docs if you would like?