Last active
February 3, 2022 16:42
-
-
Save reberthkss/337c4ee4aea4cf64a909bcc86e0645d9 to your computer and use it in GitHub Desktop.
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
data class TodoDetail ( | |
val title: String, | |
val description: String | |
) | |
class TodoDetailViewModel: ViewModel() { | |
private val _state = MutableLiveData<String>() | |
val state: LiveData<String> | |
get() = _state | |
private val _detailError = MutableLiveData<Throwable>() | |
val todoDetailError: LiveData<Throwable> | |
get() = _detailError | |
private val _todoSuccessData = MutableLiveData<TodoDetail>() | |
val todoSuccessData: LiveData<TodoDetail> | |
get() = _todoSuccessData | |
companion object { | |
const val SUCCESS = "success" | |
const val ERROR = "loading" | |
const val LOADING = "error" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment