Hi, is it possible to have multiple bindings for a...
# kodein
t
Hi, is it possible to have multiple bindings for a single interface. And inject all of them into a class? Something like
Copy code
interface Handler {}
class SomeService(val handlers: List<Handler>) { ... }
Copy code
di {
  bind<Handler> { ActualHandler1() }
  bind<Handler> { ActualHandler2() }

  bind<SomeService> { SomeService(instance())}
}
r
Yes it is , we call it Set binding, you can find the docs here https://docs.kodein.org/kodein-di/7.10/core/multi-binding.html
t
Thank you!