Observe the Ok value for side effects (logging, metrics) without changing the carried value. Passes Err through untouched.
Ok
Err
pipe( parseConfig(raw), tap((cfg) => log.info({ msg: "parsed", name: cfg.name })), flatMap(validate),); Copy
pipe( parseConfig(raw), tap((cfg) => log.info({ msg: "parsed", name: cfg.name })), flatMap(validate),);
Observe the
Okvalue for side effects (logging, metrics) without changing the carried value. PassesErrthrough untouched.