With koin-compose 3.1.4, i’ve noticed that `getSta...
# koin
x
With koin-compose 3.1.4, i’ve noticed that
getStateViewModel
is
@Deprecated
. How would one inject a view model in a
@Composable
with a
SavedStateHandle
passed through the params?
nvm: looks like
getViewModel()
does seem to return a handle. My mistake was that I was using kotlin’s destructuring before
Copy code
viewModel { (handle: SavedStateHandle) -> LoginViewModel(handle) }
and had to replace with
Copy code
viewModel { params -> LoginViewModel(handle = params.get()) }
a
API is back in 3.1.4. Has been deprecated in 3.1.3 sorry for the confusion
but else yes, basic ViewModel can handle SavedStateHandle
👍 1