Skip to content

Conversation

@arnaudgiuliani
Copy link

Hello,

I propose several parts to work with Koin annotations.

  • put common components together in CommonModule (scan annotated components with @componentscan), including db driver
  • DB drive is approached as expect/actual implementation with ContextWrapper
  • propose Context Wrapper pattern to share context easily in KMP (see DB driver) - ContextModule
  • NativeModule allows some other components to be loaded on each native side, like ViewModel
  • AppModule to centralize all modules
  • KoinApp to shape the entry point, reusable in Android (to pass context) and iOS

Note: Be aware that we are stuck with KSP2 on KMP classes scanning, then @configuration is not usable for now. I've open an issue, but sill waiting.

We can also go with DSL if you prefer. We can use the "autowire" DSL to go faster, and avoid all teh "get()".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant