Open zsoltk opened 1 year ago
Hello there 👋 I can give you some entry points to help investigate.
As @zsoltk asked me, if you need to work around creating your own scope creator, you can check the following:
ScopeActivity
- where we provide a Activity class, handling Koin Scope creation with by activityScope()
- https://github.com/InsertKoinIO/koin/blob/704f68846949a8c1b10bb77bbf3365524b91b3d8/android/koin-android/src/main/java/org/koin/androidx/scope/ScopeActivity.kt#L35
This delegates allows us to create a scope regarding, and attach Android API to let follow the scope, and destroy it if needed (https://github.com/InsertKoinIO/koin/blob/704f68846949a8c1b10bb77bbf3365524b91b3d8/android/koin-android/src/main/java/org/koin/androidx/scope/ComponentActivityExt.kt#L55)KoinScope
composable function, to let define a scope and override local CompositionLocal (https://github.com/InsertKoinIO/koin/blob/3.5.2/compose/koin-compose/src/commonMain/kotlin/org/koin/compose/scope/KoinScope.kt#L39). it also uses CompositionKoinScopeLoader
to create/close a scope given a Composable is create or dopped.KoinScopeComponent
ensure to keep Koin context around and provides basic for inject
extensions on the right scope. AndroidScopeComponent
is doing kinda the same.
I would say, try and experiment. Ask me any questions. Put me in review if needed 👍
Vote on this comment (add an emoji) if you'd like us to prioritise adding support for Koin in Appyx Nodes.