Mike Welsh
07/13/2023, 7:00 PMJoel Denke
07/13/2023, 7:18 PMMike Welsh
07/13/2023, 7:24 PMJoel Denke
07/14/2023, 6:43 AMJacob Ras
07/14/2023, 8:45 AMcommon
code, but still allowing that to be injected/used in app code by Hilt and Swinject?
I'm not aware of a library that does this, but I haven't looked for it. I'd say you can do this manually by creating a wrapper. For example, let's say you're using Koin inside your shared code to inject and provide TestClass
. You could then create a wrapper in your androidMain
code, where you create a Hilt module that provides TestClass
by getting it from Koin. Downside is that you have to manually provide all these, but the upside is that you can easily provide the platform-specific DI wrappers by bundling it into your shared artefacts.
This is a theoretical idea. I haven't done this yet, but I'm fairly sure something like this would work.Jacob Ras
07/14/2023, 12:48 PMVlad
07/14/2023, 5:51 PMMike Welsh
07/14/2023, 5:52 PMVlad
07/14/2023, 5:53 PMJacob Ras
07/14/2023, 5:56 PMJagtej Sodhi
07/14/2023, 9:22 PMMike Welsh
07/16/2023, 11:40 PMMike Welsh
07/18/2023, 12:22 AMJacob Ras
07/24/2023, 10:52 AMAssembly
mechanism (which is like a module in Dagger/Koin).