Adds new Result.tapEither, Result.tapEitherAsync, and ResultAsync.tapEither which all execute the given callback for both success and failure cases. This is similar to .finally() except they return the Result/ResultAsync instead of a value.
These can be useful for logging calls or setting a loading state on/off independent of whether or not the operation succeeded or failed.
Result.tapEither
,Result.tapEitherAsync
, andResultAsync.tapEither
which all execute the given callback for both success and failure cases. This is similar to.finally()
except they return the Result/ResultAsync instead of a value.These can be useful for logging calls or setting a loading state on/off independent of whether or not the operation succeeded or failed.