Skip to content

Commit

Permalink
Move return types to casts to work around Reselect update issues
Browse files Browse the repository at this point in the history
  • Loading branch information
markerikson committed Nov 5, 2021
1 parent d93b1c7 commit 11e64ea
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions packages/toolkit/src/query/core/buildSelectors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,8 @@ export function buildSelectors<
function buildQuerySelector(
endpointName: string,
endpointDefinition: QueryDefinition<any, any, any, any>
): QueryResultSelectorFactory<any, RootState> {
return (queryArgs) => {
) {
return ((queryArgs: any) => {
const selectQuerySubState = createSelector(
selectInternalState,
(internalState) =>
Expand All @@ -173,14 +173,11 @@ export function buildSelectors<
]) ?? defaultQuerySubState
)
return createSelector(selectQuerySubState, withRequestFlags)
}
}) as QueryResultSelectorFactory<any, RootState>
}

function buildMutationSelector(): MutationResultSelectorFactory<
any,
RootState
> {
return (id) => {
function buildMutationSelector() {
return ((id) => {
let mutationId: string | typeof skipToken
if (typeof id === 'object') {
mutationId = getMutationCacheKey(id) ?? skipToken
Expand All @@ -195,7 +192,7 @@ export function buildSelectors<
: internalState?.mutations?.[mutationId]) ?? defaultMutationSubState
)
return createSelector(selectMutationSubstate, withRequestFlags)
}
}) as MutationResultSelectorFactory<any, RootState>
}

function selectInvalidatedBy(
Expand Down

0 comments on commit 11e64ea

Please sign in to comment.