jean
fun fetchById(id: String?) = Either.catch(::onApiError) { id ?: return Either.Left(InOrderError.ApiError) ... }
left()
simon.vergauwen
either { }
ensureNotNull
leftIfNull { }
Either.catch(::onApiError).leftIfNull { InOrderError.ApiError }
A modern programming language that makes developers happier.