• Invokes a callback for each element in the source.

    Type Parameters

    • T

      Type of items in the source.

    Parameters

    Returns OperationFunction<T, T>

    Operation that invokes a callback for each element in the source.

    const result = tap<number>((x) => console.log(x))([1, 2, 3]);
    // Logs:
    // 1
    // 2
    // 3
    console.log([...result]); // [1, 2, 3]