Created
November 14, 2021 06:53
-
-
Save EmmanuelGuther/b5927e5582f2911ebcdf11867b9e8b80 to your computer and use it in GitHub Desktop.
sealed class to manage api calls
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 ResultData<out T> { | |
class Loading<out T>: ResultData<T>() | |
data class Success<out T>( | |
val data: T | |
): ResultData<T>() | |
data class Failure<out T>( | |
val errorMessage: String?=null, val exception: Exception?= null | |
): ResultData<T>() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment