https://kotlinlang.org logo
Title
u

user

06/29/2022, 8:51 AM
Explicit type assignment in Koin singleton I have a list of objects which are created using reflection in runtime and the types are not known in compile time. How can I define a singleton object in Koin using its class during runtime? Something like this: val configurations: List = Configuration.scanAllConfigurations() module { configurations.forEach { single(it::class) { it } } } But unfortunately we can not explicitly define Class in single{}. Is there any solution to this?