InfinitePageContext<TPageParam> class
Infinite queries
What a page function (InfiniteQueryOptions.pageFn) is handed: the param of the page to fetch, the direction, and the query's key, client, meta and cancellation token.
Its own type rather than QueryFunctionContext, so pageParam and
direction are typed instead of Object?.
Constructors
- InfinitePageContext({required QueryClient client, required QueryKey queryKey, required TPageParam pageParam, required FetchDirection direction, required QueryCancelToken signalProvider(), Object? meta})
- Built by the library for each page; a page function receives one rather than constructing it.
Properties
- client → QueryClient
-
The client the query lives in, for a page function that reads or
writes other queries.
final
- direction → FetchDirection
-
Which end of the pages this fetch is extending: FetchDirection.forward
for a next page and for every page of a refetch,
FetchDirection.backward for a previous page.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- meta → Object?
-
The query's QueryOptions.meta, if one was set.
final
- pageParam → TPageParam
-
The param this page is being fetched with:
initialPageParamfor the first page, otherwise whatgetNextPageParam(orgetPreviousPageParam, going backward) returned.final - queryKey → QueryKey
-
The key of the infinite query being fetched, for a page function that
reads its parameters from the key.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- signal → QueryCancelToken
-
Reading this marks the fetch as cancellable, exactly as it does for an
ordinary query function — and not reading it leaves the fetch
uncancellable, so a page that is already in flight still lands in the
cache when the last observer goes away.
no setter
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited