Hi, im having a hard time in finding some info abo...
# koin
d
Hi, im having a hard time in finding some info about using koin with
SavedState
mechanism. In current documentation there is no mention about that, so i thought that it is not yet release in stable version and I searched for that in alpha
2.1.0
where I actually found that for example here https://github.com/InsertKoinIO/koin/blob/2.1.0/koin-projects/koin-androidx-viewmodel/src/main/java/org/koin/androidx/viewmodel/ViewModelFactory.kt but there is nothing in changelog https://github.com/InsertKoinIO/koin/blob/2.1.0/CHANGELOG.md and samples are pretty sparse I think. Is there something im missing? If not, is it something you accept contributions for?
j
👀
a
I think you need first get understanding how to use view model
SavedState
, if I understood correctly your questions, this is the functionality you are looking for. When you get an understanding how this functionality is used in
androidX
library it is usually very simple to understand how
Koin
could improve this with injection.
d
thanks for your points, but I understand how it works from android perspective, but there is need from the koin perspective to provide correct ViewModel factory (which is already there) but also to pass
SavedStateHandle
from the fragment to this factory, which I could not find how to achieve that. I found samples where ViewModel received this handle as constructor parameter but if I use this approach in my app it crashes because it cant provide this handle ..
a
If you could provide some example of what you are trying to achive, I could check.
You could check https://github.com/InsertKoinIO/koin/issues/648 it looks like this feature is not yet fully ready on the Koin side.
d
👍 thanks, i’ve missed that. I need to pass default bundle, i will try that