Hey all, anyone can answer this question: <https:/...
# koin
p
a
you cannot describe inner scopes like that
scope block in a scope block I mean
you have to separate it, and pass explicitly it with your resolution in Koin <2.0
p
Ok thanks, that's pretty helpful. But was there a design reason why it was done this way? The snippets linked would force me to link the scopes in code. I think it'd be very useful to have this feature right in the dsl.
a
the DSL is declarative
you will be able to create a scope and nested scopes directly
but generally people using scopes tend to make too much complex things
we don't need scopes to attach things around activities
factory
is enough
but depends on your case after that
(of course)
p
Well, the idea is that a parent want to share one of its scoped objects with its children. In the case above the
DemoEncryptionHandler
holds some state that should be maintained during the activity lifecycle. Having a factory for this would render it useless. Then again, the child scope could simply "inherit" the parent scope.
Also, is the second link you posted current? I cannot find the method
linkTo
on the scope.
a
linkTo
is in current 2.1.0 alpha