Skip to content

Instantly share code, notes, and snippets.

@ivanalvarado
Created June 10, 2019 23:37
Show Gist options
  • Save ivanalvarado/2866287938b69ef35551e7d9f30cde08 to your computer and use it in GitHub Desktop.
Save ivanalvarado/2866287938b69ef35551e7d9f30cde08 to your computer and use it in GitHub Desktop.
class MyApplication : Application() {
// ...
val component: AppComponent by lazy {
DaggerAppComponent.builder()
.application(this)
.build()
}
}
val Activity.injector get() = (application as MyApplication).component
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment