You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
const someSlice = createSlice({
/* ... */
extraReducers: builder => {
builder.addMatcher(
isFulfilled(...someAsyncThunkArray), // <-- A spread argument must either have a tuple type or be passed to a rest parameter.ts(2556)
someReducer
);
}
});
Is this intended behavior? Inline document says the param (asyncThunks) is optional. New to typescript, but it looks like the type definition defined asyncThunks as a tuple?
export declare function isFulfilled<AsyncThunks extends [AnyAsyncThunk, ...AnyAsyncThunk[]]>(...asyncThunks: >AsyncThunks): (action: any) => action is FulfilledActionFromAsyncThunk<AsyncThunks[number]>;
I tried isFulfilled(someAsyncThunkArray[0], ...someAsyncThunkArray.slice(1)) which at least doesn't yell at me, but not sure if it's the correct way to do it. (someAsyncThunkArray has at least 2 items in my case)
Any suggestions?
@reduxjs/toolkit v1.6.1
typescript v4.4.3
The text was updated successfully, but these errors were encountered:
Is this intended behavior? Inline document says the param (
asyncThunks
) isoptional
. New to typescript, but it looks like the type definition definedasyncThunks
as a tuple?I tried
isFulfilled(someAsyncThunkArray[0], ...someAsyncThunkArray.slice(1))
which at least doesn't yell at me, but not sure if it's the correct way to do it. (someAsyncThunkArray
has at least 2 items in my case)Any suggestions?
@reduxjs/toolkit v1.6.1
typescript v4.4.3
The text was updated successfully, but these errors were encountered: