if I will initialize ViewModel like this will this ViewModel get deleted once I navigate to other composable?
f
Francesc
01/08/2023, 8:35 PM
As long as the screen for this composable is in the backstack the viewmodel will be kept alive. Once you pop the screen the viewmodel will be destroyed
z
Zun
01/08/2023, 8:52 PM
You can prove this yourself by logging inside the unit or placing a breakpoint there