yx_scope library

Classes

AsyncDep<Value>
A description for a dependency that implements AsyncLifecycle. This dependency will be initialized and disposed along with BaseScopeContainer.
AsyncDepListener
AsyncLifecycle
An interface for entities that must be initialized and disposed. You can use this interface both for asynchronous and synchronous initialization.
BaseChildDataScopeHolder<ScopeType, Container extends ChildDataScopeContainer<Parent, Data>, Parent extends Scope, Data>
Holder contains the state of a ChildDataScopeContainer — null or the scope itself. This is the core entity that provides access to the ChildDataScopeContainer.
BaseChildScopeHolder<ScopeType, Container extends ChildScopeContainer<Parent>, Parent extends Scope>
Holder contains the state of a ChildScopeContainer — null or the scope itself. This is the core entity that provides access to the ChildScopeContainer.
BaseDataScopeHolder<Scope, Container extends DataScopeContainer<Data>, Data>
Holder contains the state of a DataScopeContainer — null or the scope itself. This is the core entity that provides access to the DataScopeContainer.
BaseScopeContainer
A container and a description of a scope.
BaseScopeHolder<Scope, Container extends ScopeContainer>
Holder contains the state of a BaseScopeContainer — null or the scope itself. This is the core entity that provides access to the BaseScopeContainer.
ChildDataScopeContainer<Parent extends Scope, Data>
Combines ChildScopeContainer and DataScopeContainer.
ChildDataScopeHolder<Container extends ChildDataScopeContainer<Parent, Data>, Parent extends Scope, Data>
Simple holder for creating BaseChildDataScopeHolder.
ChildScopeContainer<Parent extends Scope>
Helps to have a parent in a scope. If the scope has a parent you can access parent dependencies within a current scope.
ChildScopeHolder<Container extends ChildScopeContainer<Parent>, Parent extends Scope>
Simple holder for creating BaseChildScopeHolder.
CoreScopeHolder<Scope, Container extends BaseScopeContainer>
DO NOT USE THIS CLASS MANUALLY! Use ScopeHolder, ChildScopeHolder, DataScopeHolder or ChildDataScopeHolder instead.
DataScopeContainer<Data>
Helps to have a initial data in a scope. If the scope has data, you can access it as a non-nullable value within current scope.
DataScopeHolder<Container extends DataScopeContainer<Data>, Data>
Simple holder for creating BaseDataScopeHolder.
Dep<Value>
A description for a dependency. Basically this is a factory class for any custom entity.
DepId
A ready-only unique identifier of a Dep. An instance of DepId is always the same for the same Dep instance.
DepListener
DepMeta<T>
Extract meta information about Dep, e.x. DepId. This extra class helps to stay the interface of the main Dep clean an contain only dep.get method.
Scope
This is an abstract interface for a custom developer interface that is considered to be implemented by their BaseScopeContainer.
ScopeContainer
Root BaseScopeContainer without parent scope.
ScopeContainerTestUtils
ScopeHolder<Container extends ScopeContainer>
Simple holder for creating BaseScopeHolder.
ScopeId
A ready-only unique identifier of a ScopeContainer. An instance of ScopeId is always the same for the same ScopeContainer instance.
ScopeListener
ScopeLogger
ScopeMeta
Extract meta information about BaseScopeContainer, e.x. ScopeId. This extra class helps to stay the interface of the main BaseScopeContainer clean and contain only dep-related method.
ScopeModule<Container extends BaseScopeContainer>
This class helps to decompose ScopeContainer into a number of features.
ScopeObservatory
Class for diagnostic purposes.
ScopeStateHolder<Scope>
ValueMeta
A ready-only meta info of created value in a Dep.

Enums

LogType

Mixins

ChildScopeContainerMixin<Parent extends Scope>
Mixin for BaseScopeContainer.
DataScopeContainerMixin<Data>
Mixin for BaseScopeContainer. Helps to have a initial data in a scope. If the scope has data, you can access it as a non-nullable value within current scope.

Typedefs

AsyncDepCallback<Value> = Future<void> Function(Value dep)
DepBuilder<Value> = Value Function()
A factory method that creates an entity in Dep.
OverrideDepBuilder<Container extends BaseScopeContainer, Value> = Value Function(Container container)
Callback creates an entity based on current BaseScopeContainer and will be used as a primary factory for creating an entity.
RemoveStateListener = void Function()
StateListener<S> = void Function(S scope)

Exceptions / Errors

NotifyListenerError
An error thrown when tried to update the state of a ScopeStateHolder, but some of the listeners threw an exception.
ScopeError
ScopeException