I have the following LiveData variables in my ViewModel (simplified example):
LiveData
ViewModel
val currentUser : LiveData<UserObject> val allSites : LiveData<ArrayList<SiteObject>> val filterSitesForUser : LiveData<Boolean> val orderSitesByField : LiveData<String> val orderSitesDirection : LiveData<Query.Direction> val searchFilterSitesText : LiveData<String>
You can use postValue instead of setValue
postValue
setValue
If you called this method multiple times before a main thread executed a posted task, only the last value would be dispatched.
1.4m articles
1.4m replys
5 comments
57.0k users