Skip to content

Instantly share code, notes, and snippets.

Last active Jan 15, 2019
What would you like to do?
class MyViewModel : ViewModel() {
val users: LiveData<List<String>> by unsafeLazy {
MutableLiveData<List<String>>().apply { loadUsersInto(this) }
private fun loadUsersInto(liveData: MutableLiveData<List<String>>) {
// do async operation to fetch users and update
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment