Download node_modules/@tanstack/react-query/src/usePrefetchInfiniteQuery.tsx from metarm/QMetaRam: direct link, hf CLI and curl.
- Browser
- Download file 777 Bytes
-
https://huggingface.co/metarm/QMetaRam/resolve/main/node_modules/%40tanstack/react-query/src/usePrefetchInfiniteQuery.tsx
- Command line
-
hf download hf://metarm/QMetaRam/node_modules/@tanstack/react-query/src/usePrefetchInfiniteQuery.tsx
-
curl -L -o usePrefetchInfiniteQuery.tsx https://huggingface.co/metarm/QMetaRam/resolve/main/node_modules/%40tanstack/react-query/src/usePrefetchInfiniteQuery.tsx
777 Bytes
| import { noop } from '@tanstack/query-core' | |
| import { useQueryClient } from './QueryClientProvider' | |
| import type { | |
| DefaultError, | |
| InfiniteData, | |
| QueryClient, | |
| QueryKey, | |
| } from '@tanstack/query-core' | |
| import type { UsePrefetchInfiniteQueryOptions } from './types' | |
| export function usePrefetchInfiniteQuery< | |
| TQueryFnData = unknown, | |
| TError = DefaultError, | |
| TData = InfiniteData<TQueryFnData>, | |
| TQueryKey extends QueryKey = QueryKey, | |
| TPageParam = unknown, | |
| >( | |
| options: UsePrefetchInfiniteQueryOptions< | |
| TQueryFnData, | |
| TError, | |
| TData, | |
| TQueryKey, | |
| TPageParam | |
| >, | |
| queryClient?: QueryClient, | |
| ): void { | |
| const client = useQueryClient(queryClient) | |
| if (!client.getQueryState(options.queryKey)) { | |
| void client.infiniteQuery(options).catch(noop) | |
| } | |
| } | |