Function start

  • Deprecated

    Use skipUntil instead (start will be removed in v3.0.0).

    Starts emitting values, once the predicate test passes.

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

    const i = pipe(
    [1, 2, 3, 4, 5, 6, 7, 8, 9],
    start(a => a === 5) // start emitting when 5 is encountered
    );

    console.log(...i); //=> 5, 6, 7, 8, 9

    Note that the predicate can only return a Promise inside an asynchronous pipeline, or else the Promise will be treated as a truthy value.

    See

    Type Parameters

    • T

    Parameters

    • cb: ((value: T, index: number, state: IterationState) => boolean | Promise<boolean>)
        • (value: T, index: number, state: IterationState): boolean | Promise<boolean>
        • Parameters

          Returns boolean | Promise<boolean>

    Returns Operation<T, T>