Last active
August 17, 2017 09:36
-
-
Save AkshayChordiya/653460ae1734414e47d142bd06214dde to your computer and use it in GitHub Desktop.
User View Model with LiveData
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
class UserViewModel() : ViewModel() { | |
/** | |
* The user | |
*/ | |
private var users: LiveData<List<User>> | |
init { | |
// Load the user over here | |
// users = .... | |
} | |
/** | |
* Get all the data | |
*/ | |
fun getUsers() = users | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment