if I will initialize ViewModel like this will this...
# compose
h
if I will initialize ViewModel like this will this ViewModel get deleted once I navigate to other composable?
f
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
You can prove this yourself by logging inside the unit or placing a breakpoint there