Skip to content

Instantly share code, notes, and snippets.

@ivanalvarado
Last active June 11, 2019 00:13
Show Gist options
  • Save ivanalvarado/cc23f5a4d461b8f92b032277342de911 to your computer and use it in GitHub Desktop.
Save ivanalvarado/cc23f5a4d461b8f92b032277342de911 to your computer and use it in GitHub Desktop.
@Component(modules = [AssistedInjectModule::class])
@Singleton
interface ApplicationComponent {
// ...
@Component.Builder
interface Builder {
@BindsInstance
fun application(application: Application): Builder
fun build(): AppComponent
}
// Exposes the UserDetailModel.Factory object so we can reference the create()
// method that takes a User ID String as an argument
val userDetailViewModelFactory: UserDetailViewModel.Factory
}
// Module annotated with "@AssistedModule" that references generated code (AssistedInject_AssistedInjectModule::class)
@AssistedModule
@Module(includes = [AssistedInject_AssistedInjectModule::class])
interface AssistedInjectModule
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment