@gphone/sdk
    Preparing search index...

    Interface PagedListOptions<T>

    interface PagedListOptions<T> {
        container?: () => HTMLElement | null;
        hasMore?: () => boolean;
        items: () => T[];
        loadOlder?: () => Promise<boolean>;
        olderAt?: "start" | "end";
        pageSize?: number;
        threshold?: number;
    }

    Type Parameters

    • T
    Index
    container?: () => HTMLElement | null

    The scrolling element, needed only for olderAt: 'start'.

    hasMore?: () => boolean

    Whether the server has more. Suppresses the call at the end of the feed.

    items: () => T[]

    The full list. Read reactively, so it may grow underneath the window.

    loadOlder?: () => Promise<boolean>

    Fetch the next page from the server once the local window is exhausted.

    Omit it and this hook behaves exactly as it always did — a window over a list somebody else loaded. Supplying it is what turns a client-side window into a window over a server-side one, which is what a public feed needs: the whole list is never in memory.

    Returns whether anything arrived.

    olderAt?: "start" | "end"

    Which end of the list the older rows are at.

    'start' is a chat: the window holds the newest rows, older ones are above, and revealing them has to preserve the reader's place. 'end' is a feed: the window holds the newest rows too, but older ones are below and revealing them changes nothing the reader is already looking at.

    pageSize?: number

    How many more rows each page reveals.

    threshold?: number

    Distance from the edge, in pixels, at which scrolling asks for more.