Scope can be created and linked to another scope (or more than one scope). The scope you create is the “called scope” and the others are “linked scopes"
The linking has the following properties: is the Linked scope allowed to provide existing cached instances (true by default), is Linked scope allowed to generate new instances (false by default), are new instances are cached in the called scope or the scope who’s factory actually makes the object which is either called scope or linked scope (called scope is the default).
so you would make myActivityScope linked to Injekt global
and anything already in global can be used, but it cannot create anything else, only myActivityScope can create new instances. And anything registered in myActivityScope will override the global Injekt by default
you can change the behaviour by the settings listed in # 2
So this would be called something like LocalOverridingScope with those defaults
others will want the settings to differ, such as having the global still make new instances of types it has registered but the other scope does not.
others will want the caching of the instances to be in the called scope, others in the scope that did the factory
others will want the factory called if the local scope does not have the item, but declare the factories only in the linked scope (including singleton factories)
Not sure if this is useful, because you can manually get pretty close (see updated docs at https://github.com/kohesive/injekt/blob/master/README.md#scopes) using something like the shown
MyActivityScope
orMyActivityModule
examples.so you would make myActivityScope linked to Injekt global
and anything already in global can be used, but it cannot create anything else, only myActivityScope can create new instances. And anything registered in myActivityScope will override the global Injekt by default
you can change the behaviour by the settings listed in # 2
So this would be called something like
LocalOverridingScope
with those defaultsothers will want the settings to differ, such as having the global still make new instances of types it has registered but the other scope does not.
others will want the caching of the instances to be in the called scope, others in the scope that did the factory
others will want the factory called if the local scope does not have the item, but declare the factories only in the linked scope (including singleton factories)