plainfp - v0.1.0
    Preparing search index...

    Function tapError

    • Run a side effect on the error without altering the result. Useful for logging failures without interrupting the pipeline.

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

      Type Parameters

      • T
      • E

      Parameters

      Returns ResultAsyncType<T, E>

      pipe(
      chargeCard(order),
      ResultAsync.tapError(e => logger.error("charge failed", e)),
      )
    • Run a side effect on the error without altering the result. Useful for logging failures without interrupting the pipeline.

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

      Type Parameters

      • E

      Parameters

      • fn: (error: E) => void | Promise<void>

      Returns <T>(ra: ResultAsyncType<T, E>) => ResultAsyncType<T, E>

      pipe(
      chargeCard(order),
      ResultAsync.tapError(e => logger.error("charge failed", e)),
      )