docs: Add suggestions about getInitialState on persist #2376
Unanswered
Cadienvan
asked this question in
Bug report
Replies: 1 comment 8 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
The
persist
middleware alters the behavior ofgetInitialState
because 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
afterEach
lifecycle method isn't applicable.Here's an example:
Our service slice is persisted, while the remaining 3 aren't, so our
getInitialState
will only contain thecreateServiceSlice
slice 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