plainfp - v0.1.0
    Preparing search index...

    Function tap

    • Run a side effect on the success value without altering the result. The side effect is awaited if it returns a Promise. The original ok or err flows through unchanged.

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

      Type Parameters

      • T
      • E

      Parameters

      Returns ResultAsyncType<T, E>

      pipe(
      fetchOrder(id),
      ResultAsync.tap(order => logger.info("loaded", order.id)),
      )
    • Run a side effect on the success value without altering the result. The side effect is awaited if it returns a Promise. The original ok or err flows through unchanged.

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

      Type Parameters

      • T

      Parameters

      • fn: (value: T) => void | Promise<void>

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

      pipe(
      fetchOrder(id),
      ResultAsync.tap(order => logger.info("loaded", order.id)),
      )