plainfp - v0.1.0
    Preparing search index...

    Function tap

    • Run a side effect on the value inside a Some; the option flows through unchanged. none is ignored. Useful for logging, metrics, or debugging inside a pipe.

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

      Type Parameters

      • T

      Parameters

      Returns OptionType<T>

      pipe(
      findUser(id),
      Option.tap(user => logger.debug("loaded", user.id)),
      Option.map(user => user.name),
      )
    • Run a side effect on the value inside a Some; the option flows through unchanged. none is ignored. 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 (option: OptionType<T>) => OptionType<T>

      pipe(
      findUser(id),
      Option.tap(user => logger.debug("loaded", user.id)),
      Option.map(user => user.name),
      )