Does kodein support injecting platform specific ob...
# kodein
u
Does kodein support injecting platform specific objects into multiplatform common code?
Anyone?
s
What do you mean ?
You can: - have your platform specific classes implement common interfaces - Declare an expected platformModule in common code - implement the actual platformModule in the platform code that declares platform specific bindings
u
I was wondering if there are plans to support
by kodein.instance()
in common modules. Usercase: Logging in common modules. Inject different loggers for js, Java and Android.
I think i know what is possible with multi platform builds, but multi platform is not really suited for supporting different java environments like Android and plain java
Additionally, if i use kodein for clean architecture, why should i stop that pattern when it comes to common code?
s
Well,
by kodein.instance()
IS supported in common modules
u
Found it. I was missing a gradle dependency 🙂
Thanks. Issue resolved