Last active
November 27, 2018 09:30
-
-
Save shkschneider/5e0088376d16a74d574b735787955764 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
@UiThread | |
fun getUsers(context: Context): LiveData<List<User>> { | |
if (!::users.isInitialized) { | |
users = MutableLiveData() | |
Coroutines.ioThenMain({ | |
DataManager.getUsers(context) | |
}) { | |
users.value = it | |
} | |
} | |
return users | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment