Download node_modules/@tanstack/react-query/src/usePrefetchQuery.tsx from sitcod3/modul-s: direct link, hf CLI and curl.
- Browser
- Download file 588 Bytes
-
https://huggingface.co/spaces/sitcod3/modul-s/resolve/c06e4783a2be21cd7ca9fedf1ede4d4f0156ba3a/node_modules/%40tanstack/react-query/src/usePrefetchQuery.tsx
- Command line
-
hf download hf://spaces/sitcod3/modul-s@c06e4783a2be21cd7ca9fedf1ede4d4f0156ba3a/node_modules/@tanstack/react-query/src/usePrefetchQuery.tsx
-
curl -L -o usePrefetchQuery.tsx https://huggingface.co/spaces/sitcod3/modul-s/resolve/c06e4783a2be21cd7ca9fedf1ede4d4f0156ba3a/node_modules/%40tanstack/react-query/src/usePrefetchQuery.tsx
588 Bytes
| import { useQueryClient } from './QueryClientProvider' | |
| import type { DefaultError, QueryClient, QueryKey } from '@tanstack/query-core' | |
| import type { UsePrefetchQueryOptions } from './types' | |
| export function usePrefetchQuery< | |
| TQueryFnData = unknown, | |
| TError = DefaultError, | |
| TData = TQueryFnData, | |
| TQueryKey extends QueryKey = QueryKey, | |
| >( | |
| options: UsePrefetchQueryOptions<TQueryFnData, TError, TData, TQueryKey>, | |
| queryClient?: QueryClient, | |
| ) { | |
| const client = useQueryClient(queryClient) | |
| if (!client.getQueryState(options.queryKey)) { | |
| client.prefetchQuery(options) | |
| } | |
| } | |