I have a ViewModel
which has a dependency which should be taken from the Fragment
's arguments
.
So its something like:
class SomeViewModel(someValue: SomeValue)
now the fragment recieves the SomeValue
in its arguemnt like so:
class SomeFragment : Fragment() {
val someViewModel: SomeViewModel by viewModel()
companion object {
fun newInstance(someValue: SomeValue) = SomeFragment().apply {
arguments = bundleof("someKey" to someValue)
}
}
}
problem is I don't know how to add SomeValue
thats taken from the Fragment
's arguments
to Koin
's module.
Is there a way to make the fragment contribute to the Koin Dependency Graph?