<Delegate a job to a channelFLow> I'm trying to re...
# stackoverflow
r
Delegate a job to a channelFLow I'm trying to recreate this function using LiveData to a function doing the same but with channelFlow; Always set isLoading is boring to me. Rewrite a try finally everytime too. LiveData way : private val _isLoading: MutableLiveData = MutableLiveData(false) val isLoading: LiveData = _isLoading protected fun process(job: () -> Job) { if (isLoading.value == true) return _isLoading.value = true viewModelScope.launch(Default) { try {...