Hey all, when using `either<L,R> { }` I und...
# arrow
c
Hey all, when using
either<L,R> {  }
I understand that you can bind getting some value to the context of that either, so I can do something like
val foo = !service.getThingViaEither()
What is the correct way to handle this in conjunction with validation where the return type doesn’t necessarily matter? Currently I’m doing something like
!Either.conditionally(foo.isValid(), { Error("bar") }, { true }))
I could also do something like
val isValid = !checkFooValid(foo)
but that also seems unnecessary as the isValid val will never be used
c
Instead of
val isValid = !checkFooValid(foo)
you could just write
!checkFooValid(foo)
No need to declare a variable you're not using.
🔝 1
r
After 0.13 the only option is
Copy code
checkFooValid(foo).bind()
invoke
,
not
,
componentX
are gone.
🔝 1
c
thank you : )