Skip to content

Commit ae44adc

Browse files
committed
remove isAction from isAllOf now that it's included in .match
1 parent 351eb81 commit ae44adc

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

packages/toolkit/src/dynamicMiddleware/index.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import type {
44
UnknownAction,
55
} from 'redux'
66
import { compose } from 'redux'
7-
import { createAction, isAction } from '../createAction'
7+
import { createAction } from '../createAction'
88
import { isAllOf } from '../matchers'
99
import { nanoid } from '../nanoid'
1010
import { emplace, find } from '../utils'
@@ -75,11 +75,7 @@ export const createDynamicMiddleware = <
7575
return compose(...appliedMiddleware)
7676
}
7777

78-
const isWithMiddleware = isAllOf(
79-
isAction,
80-
withMiddleware,
81-
matchInstance(instanceId)
82-
)
78+
const isWithMiddleware = isAllOf(withMiddleware, matchInstance(instanceId))
8379

8480
const middleware: DynamicMiddleware<State, Dispatch> =
8581
(api) => (next) => (action) => {

packages/toolkit/src/dynamicMiddleware/tests/index.test.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import type { Middleware } from 'redux'
22
import { createDynamicMiddleware } from '../index'
33
import { configureStore } from '../../configureStore'
44
import type { BaseActionCreator, PayloadAction } from '../../createAction'
5-
import { isAction } from '../../createAction'
65
import { createAction } from '../../createAction'
76
import { isAllOf } from '../../matchers'
87

@@ -25,7 +24,7 @@ export const makeProbeableMiddleware = <Id extends number>(
2524
): Middleware<{
2625
(action: PayloadAction<Id, typeof probeType>): Id
2726
}> => {
28-
const isMiddlewareAction = isAllOf(isAction, probeMiddleware, matchId(id))
27+
const isMiddlewareAction = isAllOf(probeMiddleware, matchId(id))
2928
return (api) => (next) => (action) => {
3029
if (isMiddlewareAction(action)) {
3130
return id

0 commit comments

Comments
 (0)