We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 55dffa4 commit 310029dCopy full SHA for 310029d
src/09-external-libraries/77-react-query-wrapper.solution.ts
@@ -1,17 +1,17 @@
1
import {
2
- QueryFunctionContext,
3
- QueryKey,
4
useQuery,
+ QueryKey,
+ QueryFunctionContext,
5
} from "@tanstack/react-query";
6
import { useAuthToken } from "fake-external-lib";
7
import { Equal, Expect } from "../helpers/type-utils";
8
9
-const useApi = <TData, TQueryKey extends QueryKey>(
+const useApi = <TQueryKey extends QueryKey, TQueryFnData>(
10
queryKey: TQueryKey,
11
queryFn: (
12
- key: QueryFunctionContext<TQueryKey>,
+ ctx: QueryFunctionContext<TQueryKey>,
13
token: string,
14
- ) => Promise<TData>,
+ ) => Promise<TQueryFnData>,
15
) => {
16
const token = useAuthToken();
17
0 commit comments