Koin Components

Bring Koin power ad hoc

KoinComponent is a Kotlin interface to help you bring Koin features to any class. By adding this interface to your class, you will be able to use following functions:

  • Injection by inject() & property()
  • Write any property with setProperty()
  • release a context with releaseContext()
  • release some properties with releaseProperties()

You need to previously start a Koin context (usally startKoin()), to be able to use any module and dependencies.

In Android, the following classes have already KoinComponent features: Application,Context, Activity, Fragment, Service