SkippableInfiniteQueryConfig
Defined in: react/src/createInfiniteQuery.ts:198
Configuration for the non-suspense infinite query hook of
createActorHooks and defineReactor (useActorInfiniteQuery): an
InfiniteQueryConfig whose getArgs may also be TanStack Query’s
skipToken, for a list whose arguments are not known yet.
A skipped list does not fetch. It has an entry of its own under its method
and config queryKey (at the canister and agent callConfig names), which
no call’s key shares, so it shows no data until the arguments arrive. Once
getArgs is a function, the list is keyed and fetched as usual. Its
refetch() has nothing to run: TanStack Query answers it with a “Missing
queryFn” error. useActorSuspenseInfiniteQuery does not take skipToken.
Example
Section titled “Example”import { skipToken } from "@ic-reactor/react"
const { data } = useActorInfiniteQuery({ functionName: "get_transactions", getArgs: account ? (start: bigint) => [{ account, start, length: 20n }] : skipToken, initialPageParam: 0n, getNextPageParam: (lastPage) => lastPage.next[0],})Extends
Section titled “Extends”Omit<InfiniteQueryConfig<Service,Method,Transform,TPageParam,Selected>,"getArgs">
Type Parameters
Section titled “Type Parameters”Service
Section titled “Service”Service = BaseActor
Method
Section titled “Method”Method extends FunctionName<Service> = FunctionName<Service>
Transform
Section titled “Transform”Transform extends TransformKey = "candid"
TPageParam
Section titled “TPageParam”TPageParam = unknown
Selected
Section titled “Selected”Selected = InfiniteData<InfiniteQueryPageData<Service, Method, Transform>, TPageParam>
Properties
Section titled “Properties”functionName
Section titled “functionName”functionName:
Method
Defined in: react/src/createInfiniteQuery.ts:136
The method to call on the canister
Inherited from
Section titled “Inherited from”Omit.functionName
callConfig?
Section titled “callConfig?”
optionalcallConfig?:CallConfig
Defined in: react/src/createInfiniteQuery.ts:138
Call configuration for the actor method
Inherited from
Section titled “Inherited from”Omit.callConfig
queryKey?
Section titled “queryKey?”
optionalqueryKey?: readonlyunknown[]
Defined in: react/src/createInfiniteQuery.ts:140
Custom query key (optional, auto-generated if not provided)
Inherited from
Section titled “Inherited from”Omit.queryKey
initialPageParam
Section titled “initialPageParam”initialPageParam:
TPageParam
Defined in: react/src/createInfiniteQuery.ts:142
Initial page parameter
Inherited from
Section titled “Inherited from”Omit.initialPageParam
getKeyArgs?
Section titled “getKeyArgs?”
optionalgetKeyArgs?: (args) =>unknown
Defined in: react/src/createInfiniteQuery.ts:154
Narrows what the cache key derives from the call arguments.
By default the key is scoped by getArgs(initialPageParam), so two
infinite queries on the same method with different arguments stay in
separate cache entries. Supply this when those args embed the cursor and
only part of them identifies the query — return the stable, serializable
portion (typically everything except the pagination field).
Parameters
Section titled “Parameters”ReactorArgs<Service, Method, Transform>
Returns
Section titled “Returns”unknown
Inherited from
Section titled “Inherited from”Omit.getKeyArgs
getNextPageParam
Section titled “getNextPageParam”getNextPageParam: (
lastPage,allPages,lastPageParam,allPageParams) =>TPageParam|null|undefined
Defined in: react/src/createInfiniteQuery.ts:156
Function to determine next page parameter
Parameters
Section titled “Parameters”lastPage
Section titled “lastPage”ReactorQueryData<ReactorReturnOk<Service, Method, Transform>>
allPages
Section titled “allPages”ReactorQueryData<ReactorReturnOk<Service, Method, Transform>>[]
lastPageParam
Section titled “lastPageParam”TPageParam
allPageParams
Section titled “allPageParams”TPageParam[]
Returns
Section titled “Returns”TPageParam | null | undefined
Inherited from
Section titled “Inherited from”Omit.getNextPageParam
getPreviousPageParam?
Section titled “getPreviousPageParam?”
optionalgetPreviousPageParam?: (firstPage,allPages,firstPageParam,allPageParams) =>TPageParam|null|undefined
Defined in: react/src/createInfiniteQuery.ts:163
Function to determine previous page parameter (for bi-directional)
Parameters
Section titled “Parameters”firstPage
Section titled “firstPage”ReactorQueryData<ReactorReturnOk<Service, Method, Transform>>
allPages
Section titled “allPages”ReactorQueryData<ReactorReturnOk<Service, Method, Transform>>[]
firstPageParam
Section titled “firstPageParam”TPageParam
allPageParams
Section titled “allPageParams”TPageParam[]
Returns
Section titled “Returns”TPageParam | null | undefined
Inherited from
Section titled “Inherited from”Omit.getPreviousPageParam
getArgs
Section titled “getArgs”getArgs: typeof
skipToken| ((pageParam) =>ReactorArgs<Service,Method,Transform>)
Defined in: react/src/createInfiniteQuery.ts:215
Function to get args from page parameter, or skipToken while the args
are not known: the list then waits without fetching.