class MyViewModel(
@InjectedParam id: Id,
private val something: Something
)
where
Something
also needs the
id
.
Is there an easy way to “propagate” the
@InjectedParam
to
Something
?
a
arnaud.giuliani
04/18/2023, 8:04 AM
a tricky one that you can solve with dsl
arnaud.giuliani
04/18/2023, 8:05 AM
Copy code
viewModel {(id:String) -> MyViewModel(id, get {parametersOf(id)})
arnaud.giuliani
04/18/2023, 8:05 AM
need to check how much we can chain/cascade arguments
d
Davide Giuseppe Farella
04/18/2023, 9:56 AM
Could it be something that we may want in Koin annotations, by propagating the
InjectedParam
to dependencies?
I have mixed feelings about it, as you usually need the injected param in the ViewModel, but then you pass it to the use case as a function param.
In my case I have a ViewModel and a
MoleculePresenter
, so it could make sense to tie the whole class to a single id, but I recognize that's not a common scenario