Add more docs and examples for Persist middleware
See original GitHub issueI think there should be examples to show how exactly to use the persist middleware
configuration for a common use-case. For example, there is no way to know how to clear data from localStorage
(or any persist mechanism), how to use the onRehydrateStorage
for common use cases.
I am not sure if it has been discussed here but store first returns the initial state before fetching the state from storage, how to handle those situations?
Let me know your thoughts!
Issue Analytics
- State:
- Created 3 years ago
- Reactions:3
- Comments:9 (1 by maintainers)
Top Results From Across the Web
Persist state with Redux Persist using Redux Toolkit in React
First, we'll add Redux Persist to our app with the following command: ... For example, to use the sessionStorage engine, we'll first import ......
Read more >20 Developing Persistence in Applications Using Oracle ...
This chapter describes how to use the visual tools in JDeveloper to implement persistence using Oracle TopLink. You can configure TopLink descriptors and ......
Read more >applyMiddleware - Redux
Another example of middleware is redux-promise. It lets you dispatch a Promise async action, and dispatches a normal action when the Promise ...
Read more >Recipes - Zustand Documentation - Pmndrs.docs
For instance, if you want to construct a single object with multiple ... persist } from 'zustand/middleware' export const useStore = create( persist(...
Read more >Creating React Apps With Redux Toolkit and RTK Query - Toptal
It includes detailed code examples ready for real-life scenarios. ... Next, we will add custom middleware for handling 401 responses by ...
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 FreeTop 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
Top GitHub Comments
I see, I think something like this can end up in the docs too. So people can implement their versions of Persist Gate.
There’s currently nothing like
PersistGate
, but it could be a nice feature to add. Though you could probably do something similar with another zustand store which could act as the gate.