Better dependency injection for Android
Arnaud Giuliani
2528

Hmm..

/**
* Return Koin context from Application
*/
@Throws(KoinApplicationException::class)
fun Application.getKoin(): Context {
if (this is KoinApplication) {
return this.koin
} else if (this is KoinMultiDexApplication) {
return this.koin
} else throw KoinApplicationException("Your application is not a Koin Application. Please use KoinApplication or KoinMultiDexApplication for your Application class.")
}

Well that’s excessive. Have you considered an interface instead?

One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.