Skip to content

Commit d2e200a

Browse files
committed
Also run handlers if action has hydration info
1 parent 1a28687 commit d2e200a

File tree

1 file changed

+6
-2
lines changed
  • packages/toolkit/src/query/core/buildMiddleware

1 file changed

+6
-2
lines changed

packages/toolkit/src/query/core/buildMiddleware/index.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,12 @@ export function buildMiddleware<
9191
// This looks for actions that aren't specific to the API slice
9292
windowEventsHandler(action, mwApi, stateBefore)
9393

94-
if (isThisApiSliceAction(action)) {
95-
// Only run these additional checks if the actions are part of the API slice
94+
if (
95+
isThisApiSliceAction(action) ||
96+
context.hasRehydrationInfo(action)
97+
) {
98+
// Only run these additional checks if the actions are part of the API slice,
99+
// or the action has hydration-related data
96100
for (let handler of handlers) {
97101
handler(action, mwApi, stateBefore)
98102
}

0 commit comments

Comments
 (0)