Download react-query/packages/solid-query/src/useInfiniteQuery.ts from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 1.9 kB
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/react-query/packages/solid-query/src/useInfiniteQuery.ts
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset@1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/react-query/packages/solid-query/src/useInfiniteQuery.ts
-
curl -L -o useInfiniteQuery.ts https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/react-query/packages/solid-query/src/useInfiniteQuery.ts
1.9 kB
| import { InfiniteQueryObserver } from '@tanstack/query-core' | |
| import { createMemo } from 'solid-js' | |
| import { useBaseQuery } from './useBaseQuery' | |
| import type { | |
| DefaultError, | |
| InfiniteData, | |
| QueryKey, | |
| QueryObserver, | |
| } from '@tanstack/query-core' | |
| import type { QueryClient } from './QueryClient' | |
| import type { | |
| DefinedUseInfiniteQueryResult, | |
| UseInfiniteQueryOptions, | |
| UseInfiniteQueryResult, | |
| } from './types' | |
| import type { Accessor } from 'solid-js' | |
| import type { | |
| DefinedInitialDataInfiniteOptions, | |
| UndefinedInitialDataInfiniteOptions, | |
| } from './infiniteQueryOptions' | |
| export function useInfiniteQuery< | |
| TQueryFnData, | |
| TError = DefaultError, | |
| TData = InfiniteData<TQueryFnData>, | |
| TQueryKey extends QueryKey = QueryKey, | |
| TPageParam = unknown, | |
| >( | |
| options: DefinedInitialDataInfiniteOptions< | |
| TQueryFnData, | |
| TError, | |
| TData, | |
| TQueryKey, | |
| TPageParam | |
| >, | |
| queryClient?: Accessor<QueryClient>, | |
| ): DefinedUseInfiniteQueryResult<TData, TError> | |
| export function useInfiniteQuery< | |
| TQueryFnData, | |
| TError = DefaultError, | |
| TData = InfiniteData<TQueryFnData>, | |
| TQueryKey extends QueryKey = QueryKey, | |
| TPageParam = unknown, | |
| >( | |
| options: UndefinedInitialDataInfiniteOptions< | |
| TQueryFnData, | |
| TError, | |
| TData, | |
| TQueryKey, | |
| TPageParam | |
| >, | |
| queryClient?: Accessor<QueryClient>, | |
| ): UseInfiniteQueryResult<TData, TError> | |
| export function useInfiniteQuery< | |
| TQueryFnData, | |
| TError = DefaultError, | |
| TData = InfiniteData<TQueryFnData>, | |
| TQueryKey extends QueryKey = QueryKey, | |
| TPageParam = unknown, | |
| >( | |
| options: UseInfiniteQueryOptions< | |
| TQueryFnData, | |
| TError, | |
| TData, | |
| TQueryKey, | |
| TPageParam | |
| >, | |
| queryClient?: Accessor<QueryClient>, | |
| ): UseInfiniteQueryResult<TData, TError> { | |
| return useBaseQuery( | |
| createMemo(() => options()), | |
| InfiniteQueryObserver as typeof QueryObserver, | |
| queryClient, | |
| ) as UseInfiniteQueryResult<TData, TError> | |
| } | |