https://kotlinlang.org logo
#koin
Title
# koin
b

bharath

08/10/2022, 6:39 AM
in documentation i can see we can specify owner and scope, but not sure where exactly we should add it You can specify the
owner
& `scope`: inline fun <_reified_ T : ViewModel> getViewModel( qualifier: Qualifier? = null, owner: ViewModelOwner = getComposeViewModelOwner(), scope: Scope = GlobalContext.get().scopeRegistry.rootScope, noinline parameters: ParametersDefinition? = null, ) Where ViewModelOwner can be used to pass a StoreOwner (like navigation): @Composable fun getComposeViewModelOwner(): ViewModelOwner { return ViewModelOwner.from( LocalViewModelStoreOwner.current!!, LocalSavedStateRegistryOwner.current ) }
3 Views