Last active
November 27, 2018 09:18
-
-
Save shkschneider/ea18290031f44fa0068bec3f9cafbce1 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
class MainViewModel : ViewModel() { | |
private lateinit var users: MutableLiveData<List<User>> | |
fun getUsers(): LiveData<List<User>> { | |
if (!::users.isInitialized) { | |
users = MutableLiveData() | |
// TODO loading of the data (hopefully using coroutines) | |
users.postValue(arrayListOf( | |
User(login = "user.name1"), | |
User(login = "user.name2") | |
)) | |
} | |
return users | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment