Emmanuel
07/18/2022, 5:04 PMfun onRefreshTrackCollection() {
val job = scope.launch {
refreshTrackCollection()
}
when(job.isCompleted) {
// show snackbar message
}
}
How do I better execute a UI change when a coroutine job is complete?Landry Norris
07/18/2022, 5:07 PMif(isShowingSnackbar)
in my compose code.Landry Norris
07/18/2022, 5:08 PMrefreshTaskCollection()
inside the launch
block.Landry Norris
07/18/2022, 5:09 PMfun onRefreshTrackCollection() {
scope.launch {
refreshTrackCollection()
isShowingSnackbarFlow.update { true }
}
}
Emmanuel
07/18/2022, 5:11 PM