We are telling Koin there are two parameters to be passed. Sadly, users have to use the unsafe:
private val realVm: CosmosDetailsVm by viewModel {
parametersOf(
intent.getParcelableExtra(ARG_CURRENCY)!!,
intent.getParcelableExtra(ARG_NETWORK)!!,
)
}
This is frustrating. Using annotation reduces some of this boilerplate for the creator, but still forces consumers to carefully pass the correct parameters.
Describe the solution you'd like
Either through the knowledge provided by the annotation @InjectedParam or some magic compiler that detects the definition of input params, have Koin generate the following extension function:
Is your feature request related to a problem? Please describe.
Given the following presumed viewModel:
and the module definition:
We are telling Koin there are two parameters to be passed. Sadly, users have to use the unsafe:
This is frustrating. Using annotation reduces some of this boilerplate for the creator, but still forces consumers to carefully pass the correct parameters.
Describe the solution you'd like
Either through the knowledge provided by the annotation
@InjectedParam
or some magic compiler that detects the definition of input params, have Koin generate the following extension function:This changes the injection caller site to look like: