Created
May 5, 2023 22:52
-
-
Save booknara/50cceb206197b6ae043b9b881b2eea13 to your computer and use it in GitHub Desktop.
It can be used when a network fetch is running/finishing to respond to ViewModel & UI component (Activity or Fragment)
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
sealed class BaseResponse<out T> { | |
data class Success<out T>(val data: T? = null): BaseResponse<T>() | |
data class Loading(val nothing: Nothing? = null): BaseResponse<Nothing>() | |
data class Error(val msg: String?): BaseResponse<Nothing>() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment