Skip to content

Instantly share code, notes, and snippets.

@ursusursus
Last active December 29, 2019 06:50
Show Gist options
  • Save ursusursus/7f141b8d764934d573bdcf72b31c6864 to your computer and use it in GitHub Desktop.
Save ursusursus/7f141b8d764934d573bdcf72b31c6864 to your computer and use it in GitHub Desktop.
@Feature1ControllerScope
@Component(dependencies = [AppComponent::class], modules = [Feature1Module::class])
interface Feature1ControllerComponent {
val viewModel: InviteViewModel
@Component.Factory
interface Factory {
fun create(
appComponent: AppComponent
): Feature1ControllerComponent
}
}
@Module
private object Feature1Module {
@JvmStatic
@Provides
fun viewModel(messageRepository: MessageRepository) = Feature1ViewModel(messageRepository)
}
@Scope
@Retention(AnnotationRetention.SOURCE)
private annotation class Feature1ControllerScope
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment