Download client/src/lib/queryClient.ts from Jiangxz/GSearch: direct link, hf CLI and curl.
- Browser
- Download file 699 Bytes
-
https://huggingface.co/spaces/Jiangxz/GSearch/resolve/main/client/src/lib/queryClient.ts
- Command line
-
hf download hf://spaces/Jiangxz/GSearch/client/src/lib/queryClient.ts
-
curl -L -o queryClient.ts https://huggingface.co/spaces/Jiangxz/GSearch/resolve/main/client/src/lib/queryClient.ts
699 Bytes
| import { QueryClient } from "@tanstack/react-query"; | |
| export const queryClient = new QueryClient({ | |
| defaultOptions: { | |
| queries: { | |
| queryFn: async ({ queryKey }) => { | |
| const res = await fetch(queryKey[0] as string, { | |
| credentials: "include", | |
| }); | |
| if (!res.ok) { | |
| if (res.status >= 500) { | |
| throw new Error(`${res.status}: ${res.statusText}`); | |
| } | |
| throw new Error(`${res.status}: ${await res.text()}`); | |
| } | |
| return res.json(); | |
| }, | |
| refetchInterval: false, | |
| refetchOnWindowFocus: false, | |
| staleTime: 1000 * 60, | |
| retry: false, | |
| }, | |
| mutations: { | |
| retry: false, | |
| } | |
| }, | |
| }); | |