File tree Expand file tree Collapse file tree 1 file changed +8
-7
lines changed
packages/toolkit/src/dynamicMiddleware/tests Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -6,14 +6,15 @@ import { isAction } from '../../createAction'
6
6
import { createAction } from '../../createAction'
7
7
import { isAllOf } from '../../matchers'
8
8
9
- export interface ProbeMiddleware
10
- extends BaseActionCreator < number , 'probeableMW/probe' > {
11
- < Id extends number > ( id : Id ) : PayloadAction < Id , 'probeableMW/probe' >
9
+ const probeType = 'probeableMW/probe'
10
+
11
+ type ProbeType = typeof probeType
12
+
13
+ export interface ProbeMiddleware extends BaseActionCreator < number , ProbeType > {
14
+ < Id extends number > ( id : Id ) : PayloadAction < Id , ProbeType >
12
15
}
13
16
14
- export const probeMiddleware = createAction < number > (
15
- 'probeableMW/probe'
16
- ) as ProbeMiddleware
17
+ export const probeMiddleware = createAction ( probeType ) as ProbeMiddleware
17
18
18
19
const matchId =
19
20
< Id extends number > ( id : Id ) =>
@@ -23,7 +24,7 @@ const matchId =
23
24
export const makeProbeableMiddleware = < Id extends number > (
24
25
id : Id
25
26
) : Middleware < {
26
- ( action : PayloadAction < Id , 'probeableMW/probe' > ) : Id
27
+ ( action : PayloadAction < Id , ProbeType > ) : Id
27
28
} > => {
28
29
const isMiddlewareAction = isAllOf ( isAction , probeMiddleware , matchId ( id ) )
29
30
return ( api ) => ( next ) => ( action ) => {
You can’t perform that action at this time.
0 commit comments