onrails
    Preparing search index...
    • Observe the Err value for side effects (logging, metrics) without changing the carried error. Passes Ok through untouched.

      Type Parameters

      • T
      • E

      Parameters

      Returns Result<T, E>

      pipe(
      loadUser(id),
      tapErr((e) => metrics.inc("user.load.fail", { kind: e.kind })),
      );
    • Observe the Err value for side effects (logging, metrics) without changing the carried error. Passes Ok through untouched.

      Type Parameters

      • E

      Parameters

      • fn: (error: E) => void

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

      pipe(
      loadUser(id),
      tapErr((e) => metrics.inc("user.load.fail", { kind: e.kind })),
      );