Function page

  • Splits values into pages of fixed size (last page can be smaller).

    import {pipe, page} from 'iter-ops';

    const i = pipe(
    [1, 2, 3, 4, 5],
    page(2)
    );

    console.log(...i); //=> [1, 2], [3, 4], [5]

    Type Parameters

    • T

    Parameters

    • size: number

    Returns Operation<T, T[]>

    TypeError: 'Page size >= 1 is required: ...' when size is less than 1 or not a number.