Skip to content

Instantly share code, notes, and snippets.

@hantrungkien
Last active September 17, 2020 16:13
Show Gist options
  • Save hantrungkien/feaafd6e38e3524d34266b07d1c753a6 to your computer and use it in GitHub Desktop.
Save hantrungkien/feaafd6e38e3524d34266b07d1c753a6 to your computer and use it in GitHub Desktop.
@Module
@InstallIn(ApplicationComponent::class)
object CoreModule {
@Provides
@Singleton
@UserModelSingletonQualifier
fun provideUserModel() = UserModel(value = "Singleton")
}
@Qualifier
@Retention(AnnotationRetention.BINARY)
annotation class UserModelSingletonQualifier
@Qualifier
@Retention(AnnotationRetention.BINARY)
annotation class UserModelFeatureQualifier
data class UserModel(var value: String = "")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment