Skip to content

Commit 93126c9

Browse files
authored
Merge pull request #4061 from reduxjs/asyncthunkcreator-fix
fix inference and order of async thunk generics
2 parents ea1017f + 3646fdf commit 93126c9

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

packages/toolkit/src/createSlice.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ interface AsyncThunkCreator<
350350
State,
351351
CurriedThunkApiConfig extends PreventCircular<AsyncThunkConfig> = PreventCircular<AsyncThunkConfig>
352352
> {
353-
<ThunkArg extends any, Returned = unknown>(
353+
<Returned, ThunkArg = void>(
354354
payloadCreator: AsyncThunkPayloadCreator<
355355
Returned,
356356
ThunkArg,
@@ -369,8 +369,8 @@ interface AsyncThunkCreator<
369369
CurriedThunkApiConfig
370370
>
371371
<
372-
ThunkArg extends any,
373-
Returned = unknown,
372+
Returned,
373+
ThunkArg,
374374
ThunkApiConfig extends PreventCircular<AsyncThunkConfig> = {}
375375
>(
376376
payloadCreator: AsyncThunkPayloadCreator<

packages/toolkit/src/tests/createSlice.typetest.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -666,8 +666,8 @@ const value = actionCreators.anyKey
666666
}
667667
),
668668
testExplicitType: create.asyncThunk<
669-
TestArg,
670669
TestReturned,
670+
TestArg,
671671
{
672672
rejectValue: TestReject
673673
}

0 commit comments

Comments
 (0)