@IntoSet capabilities
afollestad opened this issue · 1 comments
afollestad commented
A simple case:
@Module
abstract class MyModule1 {
@Provides @IntoSet
fun stringOne(): String = "hello"
}
@Module
abstract class MyModule2 {
@Provides @IntoSet
fun stringTwo(): String = "world!"
}
...
@Inject lateinit var strings: Set<String> // ["hello", "world!"]
A qualified case:
@Module
abstract class MyModule1 {
@Provides @IntoSet @HelloWorld
fun stringOne(): String = "hello"
}
@Module
abstract class MyModule2 {
@Provides @IntoSet @HelloWorld
fun stringTwo(): String = "world!"
}
...
@Inject @HelloWorld lateinit var strings: Set<String>
@Inject @HelloWorld lateinit var providedStrings: Set<Provider<String>>
@Inject @HelloWorld lateinit var providedStrings: Provider<Set<String>>
@Inject @HelloWorld lateinit var providedStrings: Provider<Set<Provider<String>>>
afollestad commented
I want to handle injecting a set of providers as well.