I’m looking for an elegant way to log each case of...
# arrow
j
I’m looking for an elegant way to log each case of an Either on my controller without going
when (either) {}
everywhere. Any ideas?
w
Either.tap
and
Either.tapLeft
?
s
Yes,
tap
and
tapLeft
allow you to run a function and peek the value without adjusting the final result. They're going to be renamed to
onRight
and
onLeft
in line with
Result#onSuccess
and
Result#onFailure
from Kotlin Std btw. Just plugging this here again in an attempt to get more feedback, this might also give you a better overview of the functionality available for Either @João Gabriel Zó. https://github.com/arrow-kt/arrow/pull/2830
219 Views