Skip to main content
Version: v8.0.0

FetchInfiniteResult


Import
import { FetchInfiniteResult } from "@hyper-fetch/core"

Preview​

type FetchInfiniteResult<R,P> = {
dehydrated: HydrateDataType[];
error: ExtractErrorType<R> | null;
hasNextPage: boolean;
items: PaginationItem<R, P>[];
pageParams: unknown[];
pages: ExtractResponseType<R>[];
responses: ResponseType<ExtractResponseType<R>, ExtractErrorType<R>, ExtractAdapterType<R>>[];
total: number | null;
}

Structure​

FetchInfiniteResult
NameTypeDescription
dehydrated
HydrateDataType[]

Pass it to client.hydrate() or the Hydrate component

error
ExtractErrorType<R> | null

Error of the page that stopped fetching

hasNextPage
boolean
items
PaginationItem<R, P>[]

Items of all the fetched pages

pageParams
unknown[]

Paging values of the fetched pages

pages
ExtractResponseType<R>[]

Response data of the fetched pages

responses
ResponseType<ExtractResponseType<R>, ExtractErrorType<R>, ExtractAdapterType<R>>[]

Full responses of the fetched pages

total
number | null

Size of the whole list, when the pagination declares total