@gphone/sdk
    Preparing search index...

    Interface PagedStore<T>

    A store over a server-paged list.

    A sibling of createCrudStore rather than a mode of it. The two genuinely differ: a CRUD store loads everything once and holds the whole set, while this one holds a window that grows, tracks a cursor, and knows whether the server has more. Teaching one factory to guess which reply shape it got works right up until a service forgets to declare paging.

    The wire shape is { rows, nextCursor }, and nextCursor: null means the end. A client that cannot tell "no more" from "ask again" scrolls forever.

    interface PagedStore<T> {
        hasMore: Readable<boolean>;
        loaded: Readable<boolean>;
        load(filter?: Record<string, unknown>): Promise<void>;
        loadMore(): Promise<boolean>;
        prepend(row: T): void;
        remove(id: number): void;
        replace(row: T): void;
    }

    Type Parameters

    • T

    Hierarchy

    • Readable<T[]>
      • PagedStore
    Index
    hasMore: Readable<boolean>

    Whether the server said there is another page.

    loaded: Readable<boolean>

    False until the first page has come back. An empty list is not the same as "none yet".

    • Replace the window with a fresh first page.

      Parameters

      • Optionalfilter: Record<string, unknown>

      Returns Promise<void>