Skip to content
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

I get no payload in REMEMBER_REHYDRATED case in reducer #4

Closed
PunainenAurinko opened this issue Jan 27, 2023 · 2 comments
Closed

I get no payload in REMEMBER_REHYDRATED case in reducer #4

PunainenAurinko opened this issue Jan 27, 2023 · 2 comments
Labels
question Further information is requested wontfix This will not be worked on

Comments

@PunainenAurinko
Copy link

I implemented redux persistence using this library based on the legacy usage examples in https://github.com/zewish/redux-remember/blob/master/LEGACY-USAGE.md and I get no payload in REMEMBER_REHYDRATED in my reducer. Payload is available in REMEMBER_PERSISTED case. I am trying this in React Native with AsyncStorage. Any help would be appreciated. Thanks.

Screen Shot 2023-01-27 at 4 57 07 PM

@zewish
Copy link
Owner

zewish commented Jan 28, 2023

Hey @PunainenAurinko, this is by design. If you read the documentation carefully, you will see there is no payload for the REMEMBER_REHYDRATED action. Your state gets injected directly into the “state” variable instead, so you should see your restored reducer state there. You are of course free to only use part of the restored state and keep everything else from your “default state” (before the rehydration) and this should be pretty straight-forward. Does the documentation need an improvement? If that's the case feel free to do a PR fixing anything that is not clear enough.

@zewish zewish added question Further information is requested wontfix This will not be worked on labels Jan 31, 2023
@zewish
Copy link
Owner

zewish commented Jan 31, 2023

I will be closing this issue for now. Feel free to reopen this in case you have more questions.

@zewish zewish closed this as completed Jan 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants