Skip to content
IC Reactor

UseReactorInfiniteQueryParameters

Defined in: react/src/hooks/useActorInfiniteQuery.ts:34

Parameters for useActorInfiniteQuery hook. Extends react-query’s UseInfiniteQueryOptions with custom reactor params.

  • Omit<UseInfiniteQueryOptions<ReactorQueryData<ReactorReturnOk<Service, Method, Transform>>, ReactorReturnErr<Service, Method, Transform>, Selected, QueryKey, TPageParam>, "queryKey" | "queryFn" | "getNextPageParam" | "initialPageParam">

Service

Method extends FunctionName<Service>

Transform extends TransformKey = "candid"

TPageParam = unknown

Selected = InfiniteData<ReactorQueryData<ReactorReturnOk<Service, Method, Transform>>, TPageParam>

reactor: Reactor<Service, Transform>

Defined in: react/src/hooks/useActorInfiniteQuery.ts:54

The reactor instance to use for method calls


functionName: Method

Defined in: react/src/hooks/useActorInfiniteQuery.ts:56

The method name to call on the canister


getArgs: typeof skipToken | ((pageParam) => ReactorArgs<Service, Method, Transform>)

Defined in: react/src/hooks/useActorInfiniteQuery.ts:63

Function to get args from page parameter, or TanStack Query’s skipToken while the args are not known: the query then waits without fetching, in an entry of its own under its method and queryKey, which no call’s key shares, so it shows no data until the args arrive.


optional getKeyArgs?: (args) => unknown

Defined in: react/src/hooks/useActorInfiniteQuery.ts:77

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). It is required when initialPageParam changes between renders, as Date.now() does: without it every render keys a new query.

ReactorArgs<Service, Method, Transform>

unknown


optional callConfig?: CallConfig

Defined in: react/src/hooks/useActorInfiniteQuery.ts:79

Agent call configuration (effectiveCanisterId, etc.)


optional queryKey?: readonly unknown[]

Defined in: react/src/hooks/useActorInfiniteQuery.ts:81

Custom query key (auto-generated if not provided)


initialPageParam: TPageParam

Defined in: react/src/hooks/useActorInfiniteQuery.ts:83

Initial page parameter


getNextPageParam: (lastPage, allPages, lastPageParam, allPageParams) => TPageParam | null | undefined

Defined in: react/src/hooks/useActorInfiniteQuery.ts:85

Function to determine next page parameter

ReactorQueryData<ReactorReturnOk<Service, Method, Transform>>

ReactorQueryData<ReactorReturnOk<Service, Method, Transform>>[]

TPageParam

TPageParam[]

TPageParam | null | undefined