scottiedog45
09/14/2019, 6:21 PMliveData
block, do I need to scope it to viewModelScope
, or is that handled automatically? Specifically I’m concerned about cancelling the job, does that still need to be done with this method?
val testLangLiveData : LiveData<String?> = liveData {
viewModelScope.launch {
try {
emit(repository.getUser().data.attributes?.locale)
} catch (e: Exception) {
}
}
}
Adam Powell
09/14/2019, 6:26 PMscottiedog45
09/14/2019, 6:31 PM