Open mariusmorabosch opened 2 weeks ago
on activity/fragment you don't pass the scope explicitly, as you resolve things from it. This ActivityScope
setup the scope you will use in the background: https://github.com/InsertKoinIO/koin/blob/main/projects/android/koin-android/src/main/java/org/koin/androidx/scope/ScopeActivity.kt#L35
@arnaudgiuliani What if you want to use a named scope though? Using the activity scope then everything is bound to the activity implicitly but if I want to have more than one scope on the same activity or just use a named scope to pass to child fragments and handle its lifecycle differently?
The compose extensions allow you to inject a ViewModel while specifying a scope, but the activity and fragments one do not. They should both support the same parameters, otherwise one has to duplicate the source code to call
resolveViewModel
with a custom scope for fragments / activities.Is there any reason why the fragment / activity do not support the scope parameter but the @Composable ones do?