Skip to content

Instantly share code, notes, and snippets.

@tfcporciuncula
Created March 8, 2023 13:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tfcporciuncula/1e9d79e8141024accd6dd2fb1271ad8d to your computer and use it in GitHub Desktop.
Save tfcporciuncula/1e9d79e8141024accd6dd2fb1271ad8d to your computer and use it in GitHub Desktop.
- @Singleton
- @Component(modules = [GreetingModule::class])
- interface ApplicationComponent {
-   @Component.Factory
-   interface Factory {
-     fun build(@BindsInstance context: Context): ApplicationComponent
-   }
-
-   val greetingHandlerFactory: GreetingHandler.Factory
+ @Component @Singleton
+ abstract class ApplicationComponent(
+   @get:Provides val context: Context,
+ ) : GreetingModule {
+   abstract val greetingHandlerCreator: (String) -> GreetingHandler
+ }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment