Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
types: make it easier to wrap createAsyncThunk
Not exporting `GetThunkAPI` requires code dup when wrapping `createAsyncThunk` (in order to get top level access to the `ThunkAPI`'s type). There also was a minor typo making the default value of the `RejectedValue` type parameter `undefined` instead of `unknown`.
  • Loading branch information
garobrik authored Apr 20, 2023
commit 13b7fe1105d7d5606dc1ac4758d17ec7cbfa7636
4 changes: 2 additions & 2 deletions packages/toolkit/src/createAsyncThunk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export type BaseThunkAPI<
S,
E,
D extends Dispatch = Dispatch,
RejectedValue = undefined,
RejectedValue = unknown,
RejectedMeta = unknown,
FulfilledMeta = unknown
> = {
Expand Down Expand Up @@ -137,7 +137,7 @@ type GetDispatch<ThunkApiConfig> = ThunkApiConfig extends {
>
: ThunkDispatch<GetState<ThunkApiConfig>, GetExtra<ThunkApiConfig>, AnyAction>

type GetThunkAPI<ThunkApiConfig> = BaseThunkAPI<
export type GetThunkAPI<ThunkApiConfig> = BaseThunkAPI<
GetState<ThunkApiConfig>,
GetExtra<ThunkApiConfig>,
GetDispatch<ThunkApiConfig>,
Expand Down