Skip to content

Commit

Permalink
Merge pull request #3739 from reduxjs/bugfix/ts-41-internals
Browse files Browse the repository at this point in the history
  • Loading branch information
markerikson authored Sep 24, 2023
2 parents 56ac613 + d6e870f commit 927f68c
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions packages/toolkit/src/query/core/buildThunks.ts
Original file line number Diff line number Diff line change
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 927f68c

Please sign in to comment.