-
-
Save GuilhE/c0b4c3ff9dc843e9d21b03c837a5949a to your computer and use it in GitHub Desktop.
Medium article - KMM
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//void example | |
sealed class ReservationResult<out T : Any> : ManagerResult<T, Throwable>() { | |
object Success : ReservationResult<Unit>() | |
data class Error(override val exception: Throwable) : ReservationResult<Nothing>() | |
} | |
//value example | |
sealed class ReservationListResult<out T : Any> : ManagerResult<T, Throwable>() { | |
data class Success(override val data: List<Event>) : ReservationListResult<List<Event>>() | |
data class Error(override val exception: Throwable) : ReservationListResult<Nothing>() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment