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