Skip to main content
Version: v8.0.0

fetchInfinite

Fetches the first pages of a list one after another, without touching the cache or the queues. Made for server rendering: pass dehydrated to the Hydrate component to render them on the client.


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

Usage​

const { dehydrated } = await fetchInfinite(getFeed, {
pagination: { cursor: "cursor", next: "nextCursor", items: "data" },
pages: 2,
});

Parameters​

fetchInfinite<R, P>(request: R, options: FetchInfiniteOptions<P>)
Parameters
NameTypeDescription
request
R
options
FetchInfiniteOptions<P>

Returns​

Promise<FetchInfiniteResult<R, P>>