@@ -116,7 +116,7 @@ export const miniSerializeError = (value: any): SerializedError => {
116
116
117
117
export type AsyncThunkConfig = {
118
118
state ?: unknown
119
- dispatch ?: Dispatch
119
+ dispatch ?: ThunkDispatch < unknown , unknown , UnknownAction >
120
120
extra ?: unknown
121
121
rejectValue ?: unknown
122
122
serializedErrorType ?: unknown
@@ -577,7 +577,7 @@ export const createAsyncThunk = /* @__PURE__ */ (() => {
577
577
578
578
function actionCreator (
579
579
arg : ThunkArg ,
580
- ) : AsyncThunkAction < Returned , ThunkArg , ThunkApiConfig > {
580
+ ) : AsyncThunkAction < Returned , ThunkArg , Required < ThunkApiConfig > > {
581
581
return ( dispatch , getState , extra ) => {
582
582
const requestId = options ?. idGenerator
583
583
? options . idGenerator ( arg )
@@ -617,7 +617,7 @@ export const createAsyncThunk = /* @__PURE__ */ (() => {
617
617
}
618
618
abortController . signal . addEventListener ( 'abort' , abortHandler )
619
619
} )
620
- ; ( dispatch as ThunkDispatch < unknown , unknown , UnknownAction > ) (
620
+ dispatch (
621
621
pending (
622
622
requestId ,
623
623
arg ,
@@ -679,9 +679,7 @@ export const createAsyncThunk = /* @__PURE__ */ (() => {
679
679
( finalAction as any ) . meta . condition
680
680
681
681
if ( ! skipDispatch ) {
682
- ; ( dispatch as ThunkDispatch < unknown , unknown , UnknownAction > ) (
683
- finalAction as any ,
684
- )
682
+ dispatch ( finalAction as any )
685
683
}
686
684
return finalAction
687
685
} ) ( )
0 commit comments