koin icon indicating copy to clipboard operation
koin copied to clipboard

Module.singleOf(crossinline constructor: (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10) Need MORE!

Open Morons opened this issue 1 year ago • 3 comments

I have 19 repositories currently to inject I NEED MORE pretty please OR alternative way

I have written a single procedure to visit all my Data table by table and do common cleanup/archiving etc. the issue is I need to inject mote than the 10 allowed!

Is there an Alternative way?

Morons avatar Oct 13 '23 15:10 Morons

Any solutions?

Morons avatar Oct 23 '23 07:10 Morons

@Morons You can refactor and extract some of your dependencies to a class and inject that class as described here https://refactoring.guru/smells/long-parameter-list. Or you write your extension on the Scope class.

bigman212 avatar Oct 29 '23 14:10 bigman212

In Kotlin language, the arbitrary number of arguments for a function is 22. This is the maximum number of dependencies you can have. I encourage you to refactor your dependencies in your case

arnaudgiuliani avatar Oct 30 '23 17:10 arnaudgiuliani

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.

stale[bot] avatar Mar 30 '24 18:03 stale[bot]