InsertKoinIO / koin

Koin - a pragmatic lightweight dependency injection framework for Kotlin & Kotlin Multiplatform
https://insert-koin.io
Apache License 2.0
8.76k stars 695 forks source link

Add Object support for koin annotation. #1860

Open Jadyli opened 2 months ago

Jadyli commented 2 months ago

For example:

@Singleton(binds = [BaseAClass::class])
object AObject: BaseAClass() {}

Koin only support class now. I have to use:

@Factory(binds = [BaseAClass::class])
fun koinAObject() = AObject