You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on May 10, 2022. It is now read-only.
Scopes provide the user with a wider ability to structure the dependency graph. Currently ArchKnife provides no support for that - everything is scoped as Singleton (or no scope of course).
In order to provide this features, there are different steps required as well as several core library changes (to ArchKnife).
Extend each Provide(...) annotation to include a scope annotation class as member. By default it should use Singleton::class.
Add new annotation ProvideScope. This class has the member dependency. If null, it will use the AppComponent (Singleton scope) as dependency. This annotation can only be used on other annotations. Therefore the dev needs to create a scope annotation class which then will be used by the ArchKnife processor.
Add new processor that will create app component classes that will use the dependent member based on the dependency value. Each scope will be mapped against a certain component class.
The component processor needs to create the builder modules (activity, fragment, viewmodel, ...) based on the scope.
Renamed ArchKnifeComponent to AppComponent
Add new processor that is creating a static object that is holding the references for the components and provides options to retrieve the component instance and to clear a given one (simplify set it to null). The getter ensures to always return non-null objects.
Scopes provide the user with a wider ability to structure the dependency graph. Currently ArchKnife provides no support for that - everything is scoped as Singleton (or no scope of course).
In order to provide this features, there are different steps required as well as several core library changes (to ArchKnife).