https://kotlinlang.org logo
#kodein
Title
s

salomonbrys

03/15/2016, 2:57 PM
Each of my managers gets a JsonObject at constructor that's injected by the module. This is the binding:
bind<JsonObject>("config") with factory { name: String -> config[name].obj }
Then, for the managers:
bind<Whatever>() with singleton { WhateverImpl(instance(), instance(), factory<String, JsonObject>("config").invoke("Whatever")) }