Function tap

  • Taps into each value, without changing the output, for logging or debugging.

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

    const i = pipe(
    'text',
    tap(a => {
    console.log(a); //=> t e x t
    })
    ); //=> IterableExt<string>

    const result = [...i]; // t e x t

    Type Parameters

    • T

    Parameters

    • cb: ((value: T, index: number, state: IterationState) => void)
        • (value, index, state): void
        • Parameters

          Returns void

    Returns Operation<T, T>