Skip to content

Commit d6e870f

Browse files
committedSep 24, 2023
Try working around TS 4.1 mismatch
1 parent 3965a58 commit d6e870f

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed
 

‎packages/toolkit/src/query/core/buildThunks.ts

+8-2
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,10 @@ export function buildThunks<
254254
return
255255
}
256256

257-
const newValue = api.endpoints[endpointName].select(args)(getState())
257+
const newValue = api.endpoints[endpointName].select(args)(
258+
// Work around TS 4.1 mismatch
259+
getState() as RootState<any, any, any>
260+
)
258261

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

278-
const currentState = endpointDefinition.select(args)(getState())
281+
const currentState = endpointDefinition.select(args)(
282+
// Work around TS 4.1 mismatch
283+
getState() as RootState<any, any, any>
284+
)
279285

280286
let ret: PatchCollection = {
281287
patches: [],

0 commit comments

Comments
 (0)
Please sign in to comment.