File tree Expand file tree Collapse file tree 2 files changed +10
-8
lines changed
packages/toolkit/src/listenerMiddleware Expand file tree Collapse file tree 2 files changed +10
-8
lines changed Original file line number Diff line number Diff line change 3
3
createAction ,
4
4
createSlice ,
5
5
isAnyOf ,
6
- isFSA ,
6
+ isFluxStandardAction ,
7
7
} from '@reduxjs/toolkit'
8
8
import type { Mock } from 'vitest'
9
9
import { vi } from 'vitest'
@@ -1521,7 +1521,9 @@ describe('createListenerMiddleware', () => {
1521
1521
currentState ,
1522
1522
previousState
1523
1523
) : action is PayloadAction < number > => {
1524
- return isFSA ( action ) && typeof action . payload === 'boolean'
1524
+ return (
1525
+ isFluxStandardAction ( action ) && typeof action . payload === 'boolean'
1526
+ )
1525
1527
} ,
1526
1528
effect : ( action , listenerApi ) => {
1527
1529
expectExactType < PayloadAction < number > > ( action )
@@ -1530,7 +1532,9 @@ describe('createListenerMiddleware', () => {
1530
1532
1531
1533
startListening ( {
1532
1534
predicate : ( action , currentState ) => {
1533
- return isFSA ( action ) && typeof action . payload === 'number'
1535
+ return (
1536
+ isFluxStandardAction ( action ) && typeof action . payload === 'number'
1537
+ )
1534
1538
} ,
1535
1539
effect : ( action , listenerApi ) => {
1536
1540
expectExactType < UnknownAction > ( action )
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ import type {
8
8
} from 'redux'
9
9
import type { ThunkDispatch } from 'redux-thunk'
10
10
import type { TaskAbortError } from './exceptions'
11
+ import { NoInfer } from '../tsHelpers'
11
12
12
13
/**
13
14
* @internal
@@ -444,7 +445,7 @@ export interface AddListenerOverloads<
444
445
) : Return
445
446
446
447
/** Accepts an RTK matcher function, such as `incrementByAmount.match` */
447
- < MA extends ReduxAction , M extends MatchFunction < MA > > (
448
+ < M extends MatchFunction < UnknownAction > > (
448
449
options : {
449
450
actionCreator ?: never
450
451
type ?: never
@@ -581,10 +582,7 @@ export type FallbackAddListenerOptions = {
581
582
*/
582
583
583
584
/** @public */
584
- export type GuardedType < T > = T extends (
585
- x : any ,
586
- ...args : unknown [ ]
587
- ) => x is infer T
585
+ export type GuardedType < T > = T extends ( x : any , ...args : any [ ] ) => x is infer T
588
586
? T
589
587
: never
590
588
You can’t perform that action at this time.
0 commit comments