react-query-kit
Version:
🕊️ A toolkit for ReactQuery that make ReactQuery hooks more reusable and typesafe
19 lines (17 loc) • 521 B
text/typescript
import { createBaseQuery } from './createBaseQuery'
import type {
CompatibleError,
CreateInfiniteQueryOptions,
InfiniteQueryHook,
} from './types'
import { ReactQuery } from './utils'
export function createInfiniteQuery<
TFnData,
TVariables = void,
TError = CompatibleError,
TPageParam = number
>(
options: CreateInfiniteQueryOptions<TFnData, TVariables, TError, TPageParam>
): InfiniteQueryHook<TFnData, TVariables, TError, TPageParam> {
return createBaseQuery(options, ReactQuery.useInfiniteQuery)
}