infinity-fetch - v1.5.0
    Preparing search index...

    Type Alias LinkFetchConfig<TResponse, TItem, TOut>

    LinkFetchConfig: PaginationOptions<TResponse, TItem, TOut> & {
        url: string;
        fetcher: (params: LinkParams, context: FetchContext) => Promise<TResponse>;
        getItems: (response: TResponse) => TItem[] | Promise<TItem[]>;
        rel?: string;
        getLinkHeader?: (response: TResponse) => string | null | undefined;
    }

    Type Parameters

    • TResponse
    • TItem
    • TOut = TItem

    Type Declaration

    • url: string

      URL of the first page

    • fetcher: (params: LinkParams, context: FetchContext) => Promise<TResponse>
    • getItems: (response: TResponse) => TItem[] | Promise<TItem[]>

      Extracts items from a single page response. May be async

    • Optionalrel?: string

      Link relation to follow. Defaults to 'next'

    • OptionalgetLinkHeader?: (response: TResponse) => string | null | undefined

      Optional: returns the raw Link header value. Defaults to response.headers.get('link'), which works with a fetch Response.