<@U0BLRBFMM>: still have issues with how you inten...
# kodein
a
@salomonbrys: still have issues with how you intend "kodein" to be accessible from imported modules. For example: A module:
Copy code
object KodeinCognitoIdentity {
    val module = Kodein.Module {
        bind<CognitoJwtVerificationService>() with singleton { CognitoJwtVerificationService(instance(), instance()) }
        bind<CognitoIdentityService>() with singleton { CognitoIdentityService(instance(), AmazonCognitoIdentityClient(instance<AWSCredentialsProviderChain>()), instance()) }
    }
}
One of the classes it is registering:
Copy code
class CognitoIdentityService(private val config: IdentityConfig, private val cognitoClient: AmazonCognitoIdentity, private val jwtVerification: CognitoJwtVerificationService) { 
    val LOG: Logger by KODEINNEEDED.withClass().instance() // how do I have a KODEIN instance here?!?
}
now, I want the logger and a few other things to NOT be in the constructor because for example they are based on the actual class (the logger for example should be a delegate
withClass
) With this model you would need to pass down the kodein instance to all modules (make each a function that returns a module) , yet Kodein instance is not known during module import. Without that you have to put everything in the constructor or use KodeinGlobalAware instead of specific instances. Is there a way to inject the current kodein that is importing the module?