Jimmy Alvarez
03/04/2021, 7:49 PMsuspend fun killSession(): Either<LowUnprotectedError, Unit>
use void to represent the the effect full operation but feels wear, i think should be a better way to represent this kind of operationsaballano
03/04/2021, 9:09 PMaballano
03/04/2021, 9:10 PMraulraja
03/05/2021, 8:34 AMobject SessionKilled
even if you are ignoring it, it’s more clear what it means and not open to interpretation as to what happen when someone reads the function signature:
suspend fun killSession(): Either<LowUnprotectedError, SessionKilled>
I prefer this style if the api is public since Unit has the double meaning of being auto coerced in blocks if you don’t return anything.
This would make sure you never forget a return in the right place.Jimmy Alvarez
04/14/2021, 8:27 PMsuspend fun killSession(): Either<LowUnprotectedError, Unit>
but @raulraja`s option is a very good point, for sure i’ll do the respective refactor. Thanks