The Pagination sub-controller is responsible for navigating between pages of results in a commerce interface.

interface Pagination {
    state: PaginationState;
    fetchMoreProducts(): void;
    nextPage(): void;
    previousPage(): void;
    selectPage(page: number): void;
    setPageSize(pageSize: number): void;
    subscribe(listener: () => void): Unsubscribe;
}

Hierarchy (View Summary)

Methods

  • Fetches the next page of products, and appends them to the current list of products.

    Returns void

  • Navigates to the next page.

    Returns void

  • Navigates to the previous page.

    Returns void

  • Navigates to a specific page.

    Parameters

    • page: number

      The page to navigate to.

    Returns void

  • Sets the page size.

    Parameters

    • pageSize: number

      The page size.

    Returns void

  • Adds a callback that's invoked on state change.

    Parameters

    • listener: () => void

      A callback that's invoked on state change.

    Returns Unsubscribe

    A function to remove the listener.

Properties

A scoped and simplified part of the headless state that is relevant to the Pagination sub-controller.