am a bit confused with
hilt-navigation
documentation.
inline fun <reified VM : ViewModel> hiltViewModel()
and
internal fun <VM : ViewModel> hiltViewModel(
kClass: KClass<VM>,
backStackEntry: NavBackStackEntry
)
and
hiltNavGraphViewModel()
documentation says that it gets or creates
ViewModel
scoped to the current
navigation graph. as far as I know and what I see in code if current
ViewModelStoreOwned
is
NavBackStackEntry
, which composables in graph are,
ViewModel
is scoped to
NavBackStackEntry
.
hiltViewModel<HomeViewModel>(backStackEntry)
and
hiltViewModel<HomeViewModel>()
should be the same right? it scopes
ViewModel
to current back stack entry?