What's a good way to handle loading state in compo...
# compose
a
What's a good way to handle loading state in compose? In my case I have multiple observables in the View Model which are wrapped by a result sealed class that contains states like success, loading and error. it doesn't feel clean to determine if the progress should show based on all the observable states I have. if( r1 is Result.Loading || r2 is Result.Loading || r3 is Result.Loading) showProgress()
Is spearating the loading state to it's own observable that contains the loading state for all the other observables and using it in compose a good idea? val isLoading = MutableStateFlow(false) and using that in
r
You can use a MediatorLiveData if you are emitting a livedata or a combinedflow if you are emitting flows