@tusss/ood
    Preparing search index...

    Class Paginable<TData>

    A generic wrapper that encapsulates a list of data items and its associated pagination metadata.

    Wrapping search results with Paginable

    const pagination = new Pagination({ page: 1, perPage: 2 });
    const result = new PaginationResult(pagination, 5);
    const items = ['apple', 'banana'];

    const paginable = new Paginable(items, result);
    console.log(paginable.data); // ['apple', 'banana']
    console.log(paginable.pagination.total); // 5

    Type Parameters

    • TData = any

      The type of items in the data array.

    Index

    Constructors

    Properties

    Constructors

    Properties

    data: TData[]

    The paginated subset of items.

    pagination: PaginationResult

    The pagination metadata associated with the data subset.