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, index, state) => void)
        • (value, index, state): void
        • Parameters

          Returns void

    Returns Operation<T, T>