Colton Idle
04/17/2024, 5:23 PMMarcello Galhardo
04/17/2024, 7:16 PMStylianos Gakis
04/18/2024, 10:38 PMMarcello Galhardo
04/19/2024, 6:00 PMWhat does koin do to know how to scope the VM to the right place? Is it by looking up the composition local for the ViewModelStoreOwner?
Koin can either provide their own
koinViewModel
, orthogonal to hiltViewModel
, which fetches the local ViewModelStoreOwner
and use the KoinViewModelProviderFactory
or they can expose their Factory
and clients can pass it to the default viewModel
function.
If so, doesn't the multiplatform navigation artifact provide the right local for this on each destination?
Yes, Navigation KMP provides a NavBackStackEntry that is your local ViewModelStoreOwner.
What will koin need to do especially to support this here which isn't already done?
Koin will need to (1) depend upon the JetBrains Multiplatform artifact, (2) migrate their
koinViewModel
function and Factory
to common, (3) migrate their Binding and Constructor DSL to provide the ViewModel support in common instead of Android.
Theoretically, that should be enough.Stylianos Gakis
04/19/2024, 6:04 PMColton Idle
04/24/2024, 2:54 AMarnaud.giuliani
04/24/2024, 9:50 AMKoin can either provide their ownYeah this is already the Koin approach to provide a parallel API to Hilt ones, trying to wire on same and, orthogonal tokoinViewModel
, which fetches the localhiltViewModel
and use theViewModelStoreOwner
or they can expose theirKoinViewModelProviderFactory
and clients can pass it to the defaultFactory
function.viewModel
KoinNavViewModel
is working with NavBackStackEntry in the same wayarnaud.giuliani
04/24/2024, 11:23 AMKoin will need to (1) depend upon the JetBrains Multiplatform artifact, (2) migrate theirfunction andkoinViewModel
to common, (3) migrate their Binding and Constructor DSL to provide the ViewModel support in common instead of Android.Factory
Theoretically, that should be enough.clearly yes 🙂
Colton Idle
04/27/2024, 4:30 PMarnaud.giuliani
04/29/2024, 8:48 AM