docs: Add suggestions about getInitialState on persist #2376
Unanswered
Cadienvan
asked this question in
Bug report
Replies: 1 comment 8 replies
-
Beta Was this translation helpful? Give feedback.
8 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
The
persistmiddleware alters the behavior ofgetInitialStatebecause of internal reasons mentioned in #2277.When following the documentation here while having a persisted state accompanied by a non-persisted one, the suggestion about getInitialState in the vite's
afterEachlifecycle method isn't applicable.Here's an example:

Our service slice is persisted, while the remaining 3 aren't, so our
getInitialStatewill only contain thecreateServiceSliceslice of the state.I'd love to mention it in a PR if you have any idea about how to properly handle this.
Beta Was this translation helpful? Give feedback.
All reactions