Skip to content

Commit da56f7d

Browse files
committed
Added comment to 64
1 parent 7e23e51 commit da56f7d

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

src/09-external-libraries/64-react-query-wrapper.problem.ts

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
1-
import {
2-
QueryFunctionContext,
3-
QueryKey,
4-
useQuery,
5-
} from "@tanstack/react-query";
1+
import { useQuery } from "@tanstack/react-query";
62
import { useAuthToken } from "fake-external-lib";
73
import { Equal, Expect } from "../helpers/type-utils";
84

5+
/**
6+
* Here, we're attempting to create a wrapper around react-query's useQuery
7+
* hook. We're doing that so we can inject the auth token into the queryFn
8+
* without having to pass it in every time.
9+
*
10+
* 1. Change the type definitions of useApi to fix the errors below. Where
11+
* possible, use types from react-query to describe the types of the
12+
* parameters.
13+
*/
914
const useApi = (
1015
queryKey: any[],
1116
queryFn: (key: any, token: string) => Promise<any>,

0 commit comments

Comments
 (0)