InsertKoinIO / koin-annotations

Koin Annotations - About Koin - a pragmatic lightweight dependency injection framework for Kotlin & Kotlin Multiplatform insert-koin.io
https://insert-koin.io
Apache License 2.0
160 stars 43 forks source link

ForwardedParameters #124

Open undermark5 opened 7 months ago

undermark5 commented 7 months ago

Is your feature request related to a problem? Please describe. There does not appear to be a way to forward injected parameters to another managed dependency without writing that code out manually. Ideally there should be a way to name and forward injected parameters.

Describe the solution you'd like Perhaps a new annotation @ForwardedParameters which accepts an array of names, and a name property on the @InjectedParameter. The specified injected parameters are then forwarded to the specific dependency as injected parameters (in the order specified by the order in the array of names)

Describe alternatives you've considered Implementing KoinComponent and manually writing the injector/getter in the constructor as a default parameter value using the appropriate injected parameters. Or using KoinJavaComponent.get/inject

Target Koin project koin-annotations

stale[bot] commented 2 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

undermark5 commented 1 month ago

Not stale, and issue #148 is effectively a duplicate of this (Unless I'm misunderstanding)

arnaudgiuliani commented 3 weeks ago

Let's see how we can formulate that 👍