Created
March 8, 2023 01:39
-
-
Save tfcporciuncula/9824df99a4fff23f19f7c098cacd7c20 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class GreeterApplication : Application(), ApplicationComponentProvider { | |
override val component by lazy(LazyThreadSafetyMode.NONE) { | |
DaggerApplicationComponent.factory().build(applicationContext) | |
} | |
} | |
interface ApplicationComponentProvider { | |
val component: ApplicationComponent | |
} | |
// To help accessing the component later | |
val Context.applicationComponent get() = (applicationContext as ApplicationComponentProvider).component |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment