Skip to main content
Version: v10.0.0

InfiniteQueryState

The state of an infinite query: the rows of its window, split into pages


Import
import { InfiniteQueryState } from "@hyper-fetch/db"

Preview​

type InfiniteQueryState<Item> = QueryState<Item[]> & { isFetchingNextPage: boolean; pages: Item[][] };

Structure​

InfiniteQueryState
NameTypeDescription
data
Data | undefined

undefined until the query has loaded, then the selected fields of every row

error
unknown

The last failure, also when a refresh failed and the rows stay

hasNextPage
boolean

Whether a paginated query has another page

isFetching
boolean

Whether a request for the query is in flight

stale
boolean

Whether the rows may be out of date: their subset is stale or its syncs are disconnected

status
QueryStatus

error only when a first load failed and there is nothing to show

isFetchingNextPage
boolean

Whether more rows are loading to fill the window after fetchNextPage

pages
Item[][]

data split into pages of pageSize