I have a class SomeUseCase
that requires to provide a T
during its init.
class SomeUseCase<T>(
private val a: A<T>,
private val b: B<T, Foo>,
private val c: Repository<Foo>,
)
And I want to use it within Koin module, something like this:
module {
factory {
SomeUseCase<T>(
a = get(),
b = get(),
c = get(),
)
}
}
It's obvious that I have to pass a type (instead of T
). The problem is that instead of T
I would like to pass any type of object, for ex: String or Int. Is there a way to do it without defining SomeUseCase
2 times: one for String and other for Int types?
question from:
https://stackoverflow.com/questions/65911295/generic-types-in-koin-module 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…