Chris
10/25/2021, 8:54 AMval viewModel by getScope("user-session").viewModel<Class>(owner = this)
this works fine at least for koin 2.x. What happens in getscope() is it check it this scope is there or creates a new one of user-session. So that the viewmodel is bound to the user-session scope.
For koin 3.x I have to add more complex implementation
val viewModel by getScope("user-session").viewModel<Class>(owner = {ViewModelOwner.from(findNavController().getViewModelStoreOwner(R.id.graph))})
is this the way to go or is there a better solution for ? Thanks in advancearnaud.giuliani
10/26/2021, 1:31 PMkoinNavGraphViewModel
to scope a ViewModel to a nav graph - https://insert-koin.io/docs/reference/koin-android/viewmodel#navigation-graph-viewmodelChris
10/26/2021, 2:20 PMarnaud.giuliani
10/26/2021, 4:13 PMscoped
instance