File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed
packages/toolkit/src/dynamicMiddleware Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ import type {
5
5
MiddlewareAPI ,
6
6
} from 'redux'
7
7
import { compose } from 'redux'
8
- import { createAction } from '../createAction'
8
+ import { createAction , isAction } from '../createAction'
9
9
import { nanoid } from '../nanoid'
10
10
import { find } from '../utils'
11
11
import type {
@@ -93,6 +93,7 @@ export const createDynamicMiddleware = <
93
93
const middleware : DynamicMiddleware < State , Dispatch > =
94
94
( api ) => ( next ) => ( action ) => {
95
95
if (
96
+ isAction ( action ) &&
96
97
withMiddleware . match ( action ) &&
97
98
action . meta . instanceId === instanceId
98
99
) {
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ import type { Middleware } from 'redux'
2
2
import { createDynamicMiddleware } from '../index'
3
3
import { configureStore } from '../../configureStore'
4
4
import type { BaseActionCreator , PayloadAction } from '../../createAction'
5
+ import { isAction } from '../../createAction'
5
6
import { createAction } from '../../createAction'
6
7
7
8
export interface ProbeMiddleware
@@ -22,7 +23,11 @@ export const makeProbeableMiddleware =
22
23
( api ) =>
23
24
( next ) =>
24
25
( action ) => {
25
- if ( probeMiddleware . match ( action ) && action . payload === id ) {
26
+ if (
27
+ isAction ( action ) &&
28
+ probeMiddleware . match ( action ) &&
29
+ action . payload === id
30
+ ) {
26
31
return id
27
32
}
28
33
return next ( action )
You can’t perform that action at this time.
0 commit comments