tapErr
tapErr(result, fn)
Allows you to peek into the Err
value of a Result
, triggering a side-effect while ignoring the output.
If the result is an Ok
, this has no effect.
ts
tapErr(err("message"), (msg) => console.log(msg)); //=> err("message")
tapErr(errP("message"), async (msg) => console.log(msg)); //=> err("message")
ts
pipe(err("message"), (msg) => console.log(msg)); //=> err("message")
pipe(errP("message"), async (msg) => console.log(msg)); //=> err("message")