Skip to content

Commit 288b5e7

Browse files
committed
rm ts-ignore with strategic anys
1 parent d9fb5b6 commit 288b5e7

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

packages/toolkit/src/query/react/buildHooks.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -992,7 +992,6 @@ export function buildHooks<Definitions extends EndpointDefinitions>({
992992
}
993993

994994
function buildMutationHook(name: string): UseMutation<any> {
995-
// @ts-ignore
996995
return ({ selectFromResult, fixedCacheKey } = {}) => {
997996
const { select, initiate } = api.endpoints[name] as ApiEndpointMutation<
998997
MutationDefinition<any, any, any, any, any>,
@@ -1025,7 +1024,7 @@ export function buildHooks<Definitions extends EndpointDefinitions>({
10251024
[fixedCacheKey, promise, select]
10261025
)
10271026
const mutationSelector = useMemo(
1028-
() =>
1027+
(): Selector<RootState<Definitions, any, any>, any> =>
10291028
selectFromResult
10301029
? createSelector([selectDefaultResult], selectFromResult)
10311030
: selectDefaultResult,

packages/toolkit/src/query/react/module.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -184,13 +184,13 @@ export const reactHooksModule = ({
184184
return {
185185
name: reactHooksModuleName,
186186
init(api, { serializeQueryArgs }, context) {
187-
const anyApi = api as Api<
187+
const anyApi = api as any as Api<
188188
any,
189-
EndpointDefinitions,
189+
Record<string, any>,
190190
string,
191191
string,
192-
any
193-
> & { endpoints: any }
192+
ReactHooksModule
193+
>
194194
const { buildQueryHooks, buildMutationHook, usePrefetch } = buildHooks({
195195
api,
196196
moduleOptions: {
@@ -201,7 +201,7 @@ export const reactHooksModule = ({
201201
},
202202
serializeQueryArgs,
203203
context,
204-
} as any)
204+
})
205205
safeAssign(anyApi, { usePrefetch })
206206
safeAssign(context, { batch })
207207

0 commit comments

Comments
 (0)