@@ -116,7 +116,7 @@ export const miniSerializeError = (value: any): SerializedError => {
116116
117117export type AsyncThunkConfig = {
118118 state ?: unknown
119- dispatch ?: Dispatch
119+ dispatch ?: ThunkDispatch < unknown , unknown , UnknownAction >
120120 extra ?: unknown
121121 rejectValue ?: unknown
122122 serializedErrorType ?: unknown
@@ -577,7 +577,7 @@ export const createAsyncThunk = /* @__PURE__ */ (() => {
577577
578578 function actionCreator (
579579 arg : ThunkArg ,
580- ) : AsyncThunkAction < Returned , ThunkArg , ThunkApiConfig > {
580+ ) : AsyncThunkAction < Returned , ThunkArg , Required < ThunkApiConfig > > {
581581 return ( dispatch , getState , extra ) => {
582582 const requestId = options ?. idGenerator
583583 ? options . idGenerator ( arg )
@@ -617,7 +617,7 @@ export const createAsyncThunk = /* @__PURE__ */ (() => {
617617 }
618618 abortController . signal . addEventListener ( 'abort' , abortHandler )
619619 } )
620- ; ( dispatch as ThunkDispatch < unknown , unknown , UnknownAction > ) (
620+ dispatch (
621621 pending (
622622 requestId ,
623623 arg ,
@@ -679,9 +679,7 @@ export const createAsyncThunk = /* @__PURE__ */ (() => {
679679 ( finalAction as any ) . meta . condition
680680
681681 if ( ! skipDispatch ) {
682- ; ( dispatch as ThunkDispatch < unknown , unknown , UnknownAction > ) (
683- finalAction as any ,
684- )
682+ dispatch ( finalAction as any )
685683 }
686684 return finalAction
687685 } ) ( )
0 commit comments