Skip to content

Commit 11e64ea

Browse files
committed
Move return types to casts to work around Reselect update issues
1 parent d93b1c7 commit 11e64ea

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

packages/toolkit/src/query/core/buildSelectors.ts

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,8 @@ export function buildSelectors<
157157
function buildQuerySelector(
158158
endpointName: string,
159159
endpointDefinition: QueryDefinition<any, any, any, any>
160-
): QueryResultSelectorFactory<any, RootState> {
161-
return (queryArgs) => {
160+
) {
161+
return ((queryArgs: any) => {
162162
const selectQuerySubState = createSelector(
163163
selectInternalState,
164164
(internalState) =>
@@ -173,14 +173,11 @@ export function buildSelectors<
173173
]) ?? defaultQuerySubState
174174
)
175175
return createSelector(selectQuerySubState, withRequestFlags)
176-
}
176+
}) as QueryResultSelectorFactory<any, RootState>
177177
}
178178

179-
function buildMutationSelector(): MutationResultSelectorFactory<
180-
any,
181-
RootState
182-
> {
183-
return (id) => {
179+
function buildMutationSelector() {
180+
return ((id) => {
184181
let mutationId: string | typeof skipToken
185182
if (typeof id === 'object') {
186183
mutationId = getMutationCacheKey(id) ?? skipToken
@@ -195,7 +192,7 @@ export function buildSelectors<
195192
: internalState?.mutations?.[mutationId]) ?? defaultMutationSubState
196193
)
197194
return createSelector(selectMutationSubstate, withRequestFlags)
198-
}
195+
}) as MutationResultSelectorFactory<any, RootState>
199196
}
200197

201198
function selectInvalidatedBy(

0 commit comments

Comments
 (0)