How do you achieve the following using Koin DI:
single { AValidator() } bind IValidator::class
single { BValidator() } bind IValidator::class
single { CValidator() } bind IValidator::class
single { DValidator() } bind IValidator::class
In the class where I want to have all validators injected I use the following:
val validators: List<IValidator> by inject()
Expecting that all different implementations of interface IValidator
are injected automatically.
I know that is actually supported in Kodein, where you would simply do:
val validators: List<IValidator> by kodein.allInstances()
Would love to know whether this is possible within Koin.
Thanks!