Last active
April 14, 2020 21:54
-
-
Save EudyContreras/2cd8e9875fbdc4e4c849483db5932bc1 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
private val demoData: MutableLiveData<Resource<List<DemoData?>?>> = MutableLiveData(Resource.Loading()) | |
// Start request and emit a loading state | |
demoData.postValue(Resource.Loading() | |
// Request was successfull. Emit the data | |
demoData.postValue(Resource.Success(data)) | |
// Request failed. Emit the error, etc... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment