Fanilog
05/18/2022, 6:44 PM//TOP level composable of the app
with(LocalLifecycleOwner.current) {
lifecycleScope.launch {
navigationManager.navigationEvents
.flowWithLifecycle(lifecycle, Lifecycle.State.STARTED)
.collect { navigationDirection ->
//Listening to navigation event
navController.navigate()...
}
}
Or should I do it in LaunchEffect ? Since Compose function can execute in any order, I wanted to avoid to have it a LaunchEffect and use a replay parameter of a Flow. (eg: Sending a event before the collection,)myanmarking
05/18/2022, 7:02 PMmyanmarking
05/18/2022, 7:03 PMFanilog
05/18/2022, 7:05 PMZach Klippenstein (he/him) [MOD]
05/19/2022, 6:27 PM