Hey guys. Noob question.
How are we supposed to inject a dependency in a Wasm or Js main.kt ?
I've never needed to do it before. The following doesn't seem to work :
Copy code
val getSomeUseCase: GetSomeUseCase = getKoin().get()
Or it should be working but i need to fix something.
instead and it's working. (Also working on Android with some by inject() outside of a composable context.)
But i'm starting to wonder if it's not related to the injection of the multiplatform settings lib. I added it only to the common module and i'm not sure that works for all platforms.
Copy code
single<Settings> { Settings() }
Edit: looks like it's related to the settings injection.
a
arnaud.giuliani
07/17/2025, 3:43 PM
in compose you should rely on koinInject or koinViewModel
arnaud.giuliani
07/17/2025, 3:43 PM
else you might trigger recomposition or unwanted behavior
t
Thierry Kh
07/19/2025, 10:19 PM
Thanks for the advice.
I've refactored accordingly. (And the original issue was related to multiplatform-settings.)