Skip to content
This repository has been archived by the owner on Sep 3, 2023. It is now read-only.

@IntoSet capabilities #6

Open
afollestad opened this issue Aug 2, 2019 · 1 comment
Open

@IntoSet capabilities #6

afollestad opened this issue Aug 2, 2019 · 1 comment
Labels
enhancement New feature or request

Comments

@afollestad
Copy link
Owner

afollestad commented Aug 2, 2019

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 afollestad added the enhancement New feature or request label Aug 2, 2019
@afollestad afollestad reopened this Aug 15, 2019
@afollestad
Copy link
Owner Author

I want to handle injecting a set of providers as well.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant