Lucca Beurmann
11/12/2021, 4:51 PMDmitrii Smirnov
11/12/2021, 5:40 PMLucca Beurmann
11/12/2021, 6:18 PMColton Idle
11/12/2021, 7:08 PMdewildte
11/12/2021, 8:29 PMFlow<SideEffect>
and have who ever controls the showing of the Toast
or SnackBar
collect it.dewildte
11/12/2021, 8:30 PMSideEffect
being a sealed class
.Lucca Beurmann
11/12/2021, 8:34 PMDisposableEffect(key1 = lifecycleOwner) {
viewModel.showErrorToast.observeEvent(lifecycleOwner) {
Toast.makeText(
context,
context.getString(R.string.author_details_images_erro
Toast.LENGTH_SHORT
)
.show()
}
onDispose {
viewModel.showErrorToast.removeObservers(lifecycleOwner)
}
}
Currently that's how i'm observing the viewModel eventdewildte
11/12/2021, 8:34 PMLucca Beurmann
11/12/2021, 8:36 PMLucca Beurmann
11/12/2021, 8:36 PMdewildte
11/12/2021, 8:37 PMLaunchedEffect
works fine.dewildte
11/12/2021, 8:38 PMLucca Beurmann
11/12/2021, 8:39 PMLucca Beurmann
11/12/2021, 8:40 PMTash
11/15/2021, 1:23 AM