Created
May 23, 2021 16:51
-
-
Save blaZ3/bafeb31dfdec82d89ffe393dde93b869 to your computer and use it in GitHub Desktop.
Result class for network results.
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 class Result<T> { | |
data class Success<T>(val data: T) : Result<T>() | |
data class NetworkError<T>(val code: Int, val t: Throwable? = null) : Result<T>() | |
data class NetworkFailure<T>(val t: Throwable) : Result<T>() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment