Created
September 17, 2023 16:43
-
-
Save khahani/4da29b4a0b678379fe4b0d8bea4ae6f4 to your computer and use it in GitHub Desktop.
Result.kt
This file contains hidden or 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
| sealed interface Result<out T> { | |
| data class Success<T>(val data: T) : Result<T> | |
| data class Error(val exception: Throwable? = null) : Result<Nothing> | |
| data object Loading : Result<Nothing> | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment