plainfp - v0.1.0
    Preparing search index...

    Function tap

    • Run a side effect on the success value without altering the result. The original ok or err flows through unchanged — useful for logging, metrics, or debugging inside a pipe.

      Dual API — works data-first or curried for use in pipe.

      Type Parameters

      • T
      • E

      Parameters

      Returns ResultType<T, E>

      pipe(
      parseOrder(raw),
      Result.tap(order => logger.info("parsed", order.id)),
      Result.flatMap(chargePayment),
      )
    • Run a side effect on the success value without altering the result. The original ok or err flows through unchanged — useful for logging, metrics, or debugging inside a pipe.

      Dual API — works data-first or curried for use in pipe.

      Type Parameters

      • T

      Parameters

      • fn: (value: T) => void

      Returns <E>(result: ResultType<T, E>) => ResultType<T, E>

      pipe(
      parseOrder(raw),
      Result.tap(order => logger.info("parsed", order.id)),
      Result.flatMap(chargePayment),
      )