The ResultsPerPage controller allows the end user to choose how many results to display per page.

Example: results-per-page.fn.tsx

interface ResultsPerPage {
    state: ResultsPerPageState;
    isSetTo(num: number): boolean;
    set(num: number): void;
    subscribe(listener: () => void): Unsubscribe;
}

Hierarchy (View Summary)

Methods

Properties

Methods

  • Checks whether the number of results per page is equal to the specified number.

    Parameters

    • num: number

      The number of results.

    Returns boolean

    true if the number of results is equal to the passed value, and false otherwise.

  • Updates the number of results to request per page.

    Parameters

    • num: number

      The number of results.

    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

The state of the ResultsPerPage controller.