Skip to content

Instantly share code, notes, and snippets.

@jraska
Last active February 16, 2020 20:20
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 jraska/defeb51abc0ff21525134ce0cac85ee3 to your computer and use it in GitHub Desktop.
Save jraska/defeb51abc0ff21525134ce0cac85ee3 to your computer and use it in GitHub Desktop.
@Module
class AnalyticsModule {
@Provides
@IntoSet
fun analyticsCallbacks(callbacks: AnalyticsCallbacks): ActivityLifecycleCallbacks = callbacks
}
@Module
class PushModule {
@Provides
@IntoSet
fun pushCallbacks(callbacks: PushCallbacks): ActivityLifecycleCallbacks = callbacks
}
@Component(modules = [AnalyticsModule::class, PushModule::class, /* ... other modules */])
interface AppComponent {
fun callbacks(): Set<ActivityLifecycleCallbacks>
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment