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 33 createAction ,
44 createSlice ,
55 isAnyOf ,
6- isFSA ,
6+ isFluxStandardAction ,
77} from '@reduxjs/toolkit'
88import type { Mock } from 'vitest'
99import { vi } from 'vitest'
@@ -1521,7 +1521,9 @@ describe('createListenerMiddleware', () => {
15211521 currentState ,
15221522 previousState
15231523 ) : action is PayloadAction < number > => {
1524- return isFSA ( action ) && typeof action . payload === 'boolean'
1524+ return (
1525+ isFluxStandardAction ( action ) && typeof action . payload === 'boolean'
1526+ )
15251527 } ,
15261528 effect : ( action , listenerApi ) => {
15271529 expectExactType < PayloadAction < number > > ( action )
@@ -1530,7 +1532,9 @@ describe('createListenerMiddleware', () => {
15301532
15311533 startListening ( {
15321534 predicate : ( action , currentState ) => {
1533- return isFSA ( action ) && typeof action . payload === 'number'
1535+ return (
1536+ isFluxStandardAction ( action ) && typeof action . payload === 'number'
1537+ )
15341538 } ,
15351539 effect : ( action , listenerApi ) => {
15361540 expectExactType < UnknownAction > ( action )
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ import type {
88} from 'redux'
99import type { ThunkDispatch } from 'redux-thunk'
1010import type { TaskAbortError } from './exceptions'
11+ import { NoInfer } from '../tsHelpers'
1112
1213/**
1314 * @internal
@@ -444,7 +445,7 @@ export interface AddListenerOverloads<
444445 ) : Return
445446
446447 /** Accepts an RTK matcher function, such as `incrementByAmount.match` */
447- < MA extends ReduxAction , M extends MatchFunction < MA > > (
448+ < M extends MatchFunction < UnknownAction > > (
448449 options : {
449450 actionCreator ?: never
450451 type ?: never
@@ -581,10 +582,7 @@ export type FallbackAddListenerOptions = {
581582 */
582583
583584/** @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
588586 ? T
589587 : never
590588
You can’t perform that action at this time.
0 commit comments