-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Missing support for multibinds #250
Comments
There is not multibinds feature in Koject. I have never used that feature, so I do not know why it is necessary. |
We have multi module project (with multiple apps) where some modules expose ktor interceptor. Then some other module can "collect" these interceptors without having dependecy on them, so networking module can get these interceptor from "top" - base on application being build. |
I'm not sure about ktor, but I think it works like this: // common module
@Qualifier
@Retention(AnnotationRetention.BINARY)
annotation class Interceptor1
@Qualifier
@Retention(AnnotationRetention.BINARY)
annotation class Interceptor2 // lib module1
@Provides
@Interceptor1
fun provideInterceptor1(): Interceptor {
/* ... */
} // lib module2
@Provides
@Interceptor2
fun provideInterceptor2(): Interceptor {
/* ... */
} // app module
@Provides
fun provideInterceptorSet(
@Interceptor1
interceptor1: Interceptor,
@Interceptor2
interceptor2: Interceptor
): Set<Interceptor> {
return setOf(interceptor1, interceptor2)
} // networking module
@Provides
class SameClass(
private val providerSet: Set<Provider>
) {
/* ... */
} If there is a |
Dagger allows you to bind several objects into a collection even when the objects are bound in different modules using multibindings. Similar thing is possible with Koin. Is there any way to binds object into collection in Koject?
The text was updated successfully, but these errors were encountered: