Robert Jaros
09/12/2022, 4:27 PMkvisionInit()
function (Koin doesn't have any implicit or just-in-time bindings)
• if your service class needs access to the Ktor's ApplicationCall
(e.g. for authentication) you have to add the call as constructor parameter of the service and use constructor DSL with factoryOf(::ClassName)
function
• the same applies to components with ApplicationCall injected into other components - eager or constructor injection is required
• you can use lazy evaluated injection or other scopes (e.g. single) for services that do not need to work with "ApplicationCall`
All these rules are implemented in the https://github.com/rjaros/kvision-examples/tree/master/addressbook-fullstack-ktor-koin example