Skip to content

Commit

Permalink
Merge pull request #4061 from reduxjs/asyncthunkcreator-fix
Browse files Browse the repository at this point in the history
fix inference and order of async thunk generics
  • Loading branch information
EskiMojo14 committed Jan 10, 2024
2 parents ea1017f + 3646fdf commit 93126c9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions packages/toolkit/src/createSlice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ interface AsyncThunkCreator<
State,
CurriedThunkApiConfig extends PreventCircular<AsyncThunkConfig> = PreventCircular<AsyncThunkConfig>
> {
<ThunkArg extends any, Returned = unknown>(
<Returned, ThunkArg = void>(
payloadCreator: AsyncThunkPayloadCreator<
Returned,
ThunkArg,
Expand All @@ -369,8 +369,8 @@ interface AsyncThunkCreator<
CurriedThunkApiConfig
>
<
ThunkArg extends any,
Returned = unknown,
Returned,
ThunkArg,
ThunkApiConfig extends PreventCircular<AsyncThunkConfig> = {}
>(
payloadCreator: AsyncThunkPayloadCreator<
Expand Down
2 changes: 1 addition & 1 deletion packages/toolkit/src/tests/createSlice.typetest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -666,8 +666,8 @@ const value = actionCreators.anyKey
}
),
testExplicitType: create.asyncThunk<
TestArg,
TestReturned,
TestArg,
{
rejectValue: TestReject
}
Expand Down

0 comments on commit 93126c9

Please sign in to comment.