Last active
November 6, 2018 13:08
-
-
Save sanogueralorenzo/d693a2bace731582f9d6b50c80140c32 to your computer and use it in GitHub Desktop.
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
class UserListViewModel : ViewModel() { | |
val users = MutableLiveData<Resource<List<User>>>() | |
private fun loading() = users.setLoading() | |
private fun success(userList: List<User>) = users.setSuccess(userList) | |
private fun error(throwable: Throwable) = users.setError(throwable.message) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment