Skip to content
IC Reactor

UseReactorSuspenseInfiniteQueryParameters

Defined in: react/src/hooks/useActorSuspenseInfiniteQuery.ts:32

Parameters for useActorSuspenseInfiniteQuery hook. Extends react-query’s UseSuspenseInfiniteQueryOptions with custom reactor params.

  • Omit<UseSuspenseInfiniteQueryOptions<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/useActorSuspenseInfiniteQuery.ts:52

The reactor instance to use for method calls


functionName: Method

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

The method name to call on the canister


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

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

Function to get args from page parameter

TPageParam

ReactorArgs<Service, Method, Transform>


optional getKeyArgs?: (args) => unknown

Defined in: react/src/hooks/useActorSuspenseInfiniteQuery.ts:68

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/useActorSuspenseInfiniteQuery.ts:70

Agent call configuration (effectiveCanisterId, etc.)


optional queryKey?: readonly unknown[]

Defined in: react/src/hooks/useActorSuspenseInfiniteQuery.ts:72

Custom query key (auto-generated if not provided)


initialPageParam: TPageParam

Defined in: react/src/hooks/useActorSuspenseInfiniteQuery.ts:74

Initial page parameter


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

Defined in: react/src/hooks/useActorSuspenseInfiniteQuery.ts:76

Function to determine next page parameter

ReactorQueryData<ReactorReturnOk<Service, Method, Transform>>

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

TPageParam

TPageParam[]

TPageParam | null | undefined