Skip to content

Commit ed3ba43

Browse files
committed
fix order
1 parent dc11155 commit ed3ba43

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

docs/api/getDefaultMiddleware.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,10 @@ Currently, the return value is:
9292

9393
```js
9494
const middleware = [
95+
actionCreatorInvariant,
9596
immutableStateInvariant,
9697
thunk,
9798
serializableStateInvariant,
98-
actionCreatorInvariant,
9999
]
100100
```
101101

packages/toolkit/src/actionCreatorInvariantMiddleware.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export function getMessage(type?: unknown) {
1313
return `Detected an action creator with type "${
1414
type || 'unknown'
1515
}" being dispatched.
16-
Make sure you're calling the action before dispatching, i.e. \`dispatch(actionCreator())\` instead of \`dispatch(actionCreator)\`. This is necessary even if the action has no payload.`
16+
Make sure you're calling the action before dispatching, i.e. \`dispatch(actionCreator())\` instead of \`dispatch(actionCreator)\`. This is necessary even if the action has no payload.`
1717
}
1818

1919
export function createActionCreatorInvariantMiddleware(

packages/toolkit/src/getDefaultMiddleware.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ export function getDefaultMiddleware<
133133
actionCreatorOptions = actionCreatorCheck
134134
}
135135

136-
middlewareArray.push(
136+
middlewareArray.prepend(
137137
createActionCreatorInvariantMiddleware(actionCreatorOptions)
138138
)
139139
}

0 commit comments

Comments
 (0)