mirror of
https://github.com/moghtech/komodo.git
synced 2026-04-30 14:25:22 -05:00
cleanup unnecessary type cast
This commit is contained in:
@@ -26,12 +26,7 @@ export const useRead = <
|
|||||||
"initialData" | "queryFn" | "queryKey"
|
"initialData" | "queryFn" | "queryKey"
|
||||||
>
|
>
|
||||||
) =>
|
) =>
|
||||||
useQuery(
|
useQuery([type, params], () => client.read({ type, params } as any), config);
|
||||||
[type, params],
|
|
||||||
async () =>
|
|
||||||
(await client.read({ type, params } as any)) as ReadResponses[T],
|
|
||||||
config
|
|
||||||
);
|
|
||||||
|
|
||||||
export const useWrite = <
|
export const useWrite = <
|
||||||
T extends Types.WriteRequest["type"],
|
T extends Types.WriteRequest["type"],
|
||||||
@@ -45,8 +40,7 @@ export const useWrite = <
|
|||||||
) =>
|
) =>
|
||||||
useMutation(
|
useMutation(
|
||||||
[type],
|
[type],
|
||||||
async (params: P) =>
|
(params: P) => client.write({ type, params } as any),
|
||||||
(await client.write({ type, params } as any)) as WriteResponses[T],
|
|
||||||
config
|
config
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -62,8 +56,7 @@ export const useExecute = <
|
|||||||
) =>
|
) =>
|
||||||
useMutation(
|
useMutation(
|
||||||
[type],
|
[type],
|
||||||
async (params: P) =>
|
(params: P) => client.execute({ type, params } as any),
|
||||||
(await client.execute({ type, params } as any)) as ExecuteResponses[T],
|
|
||||||
config
|
config
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user