In the following piece of code:
viewModelScope.launch {
isLoading.postValue(true)
.....
}
we are in main thread, because viewModelScope.launch
is running on main thread by default, the same as viewModelScope.launch(dispatchers.main)
In main thread, does it make sense to use postValue? i mean, shouldn't it be as:
isLoading.value = true ?
i have found plenty of this code chunk on internet, is it right or wrong??