We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 3dd91ca + 3d4e058 commit 3965a58Copy full SHA for 3965a58
docs/rtk-query/usage/persistence-and-rehydration.mdx
@@ -44,9 +44,15 @@ export const api = createApi({
44
baseQuery: fetchBaseQuery({ baseUrl: '/' }),
45
// highlight-start
46
extractRehydrationInfo(action, { reducerPath }) {
47
+ // when persisting the root reducer
48
if (action.type === REHYDRATE) {
49
return action.payload[reducerPath]
50
}
51
+
52
+ // when persisting the api reducer
53
+ if (action.type === REHYDRATE && action.key === 'key used with redux-persist') {
54
+ return action.payload
55
+ }
56
},
57
// highlight-end
58
endpoints: (build) => ({
0 commit comments