We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
phryneas
markerikson
EskiMojo14
Learn more about funding links in repositories.
Report abuse
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