File tree Expand file tree Collapse file tree 2 files changed +20
-14
lines changed
packages/toolkit/src/query/core Expand file tree Collapse file tree 2 files changed +20
-14
lines changed Original file line number Diff line number Diff line change 11import type {
22 Action ,
33 AsyncThunkAction ,
4+ Dispatch ,
45 Middleware ,
56 MiddlewareAPI ,
67 ThunkAction ,
@@ -54,6 +55,10 @@ export interface BuildMiddlewareInput<
5455 api : Api < any , Definitions , ReducerPath , TagTypes >
5556 assertTagType : AssertTagTypes
5657 selectors : AllSelectors
58+ getRunningQueryThunk : (
59+ endpointName : string ,
60+ queryArgs : any ,
61+ ) => ( dispatch : Dispatch ) => QueryActionCreatorResult < any > | undefined
5762}
5863
5964export type SubMiddlewareApi = MiddlewareAPI <
Original file line number Diff line number Diff line change @@ -618,20 +618,6 @@ export const coreModule = ({
618618 } )
619619 safeAssign ( api . internalActions , sliceActions )
620620
621- const { middleware, actions : middlewareActions } = buildMiddleware ( {
622- reducerPath,
623- context,
624- queryThunk,
625- mutationThunk,
626- infiniteQueryThunk,
627- api,
628- assertTagType,
629- selectors,
630- } )
631- safeAssign ( api . util , middlewareActions )
632-
633- safeAssign ( api , { reducer : reducer as any , middleware } )
634-
635621 const {
636622 buildInitiateQuery,
637623 buildInitiateInfiniteQuery,
@@ -656,6 +642,21 @@ export const coreModule = ({
656642 getRunningQueriesThunk,
657643 } )
658644
645+ const { middleware, actions : middlewareActions } = buildMiddleware ( {
646+ reducerPath,
647+ context,
648+ queryThunk,
649+ mutationThunk,
650+ infiniteQueryThunk,
651+ api,
652+ assertTagType,
653+ selectors,
654+ getRunningQueryThunk,
655+ } )
656+ safeAssign ( api . util , middlewareActions )
657+
658+ safeAssign ( api , { reducer : reducer as any , middleware } )
659+
659660 return {
660661 name : coreModuleName ,
661662 injectEndpoint ( endpointName , definition ) {
You can’t perform that action at this time.
0 commit comments