Skip to content

Commit

Permalink
Try working around TS 4.1 mismatch
Browse files Browse the repository at this point in the history
  • Loading branch information
markerikson committed Sep 24, 2023
1 parent 3965a58 commit d6e870f
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions packages/toolkit/src/query/core/buildThunks.ts
Expand Up @@ -254,7 +254,10 @@ export function buildThunks<
return
}

const newValue = api.endpoints[endpointName].select(args)(getState())
const newValue = api.endpoints[endpointName].select(args)(
// Work around TS 4.1 mismatch
getState() as RootState<any, any, any>
)

const providedTags = calculateProvidedBy(
endpointDefinition.providesTags,
Expand All @@ -275,7 +278,10 @@ export function buildThunks<
(dispatch, getState) => {
const endpointDefinition = api.endpoints[endpointName]

const currentState = endpointDefinition.select(args)(getState())
const currentState = endpointDefinition.select(args)(
// Work around TS 4.1 mismatch
getState() as RootState<any, any, any>
)

let ret: PatchCollection = {
patches: [],
Expand Down

0 comments on commit d6e870f

Please sign in to comment.