-
Notifications
You must be signed in to change notification settings - Fork 866
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Accessing persistor in unconnected part of app? #349
Comments
I'm basically wondering the same thing / having a hard time ): |
@Viral-Inc can you expand on that please? Right now I'm setting the persistor as a global variable on |
@FoxxMD me using
|
Me too. Any tips? |
couple of options:
import { purgeStoredState } from 'redux-persist'
import { persistConfig } from 'somewhere you defined it'
// ...
purgeStoredState(persistConfig)
I would recommend option 1 when possible |
In my app I call
persistStore
when initializing store for the first timeBecause I need
REHYDRATE
to fire so I can get stored user auth info and skip login, etc.If there is no user auth info (IE user is logged out) I would like to do something similar to #253 and call
persistor.pause()
if the user has not checked "remember me" when they login.However in the documentation I don't see a clear way to access
persistor
after it's initially created. How can I do this? Does it require recreating my entire store using the current store as initial state? just so i can get anotherpersistor
?The text was updated successfully, but these errors were encountered: