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

Does koin support component lifecycle management? #1861

Open kobe2000 opened 2 months ago

kobe2000 commented 2 months ago

Like PostDestroy annotation in Spring Framework.

arnaudgiuliani commented 1 month ago

Yes, seems not documented. Bu you can do something:

single { ComponentA() } onClose {
                        //.. instance is closed
                    }