yasml library

Classes

AsyncComposer
an extension of Composer which additionally exposes methods for watching FutureQuery and StreamQuery while conveniently expsosing there values as Futures instead of AsyncValues. It is used in the AsyncComposition
AsyncComposition<T>
A Composition that is created for composing Queries that expose AsyncValues, such as FutureQuery and StreamQuery. the AsyncComposition.compose method returns a Future while the Composition emits a single AsyncValue that represents the state of the Future, which can be loading, error or data. It is used to easily compose multiple async queries' AsyncValues together and manage their state in a single AsyncValue.
AsyncData<T>
A class that represents the data state of an asynchronous operation. It is used when the operation has completed successfully with data.
AsyncError<T>
A class that represents the error state of an asynchronous operation. It is used when the operation has completed with an error.
AsyncLoading<T>
A class that represents the loading state of an asynchronous operation. It is used when the operation is still in progress.
AsyncValue<T>
A class that represents the state of an asynchronous operation. It can be in one of three states: loading, error or data. It is used to represent the state of a query that is based on a Future or a Stream, and it is used to manage the state of the query in the query container.
Command<T>
A command mutates the state. Because of mutated state it is possible That some queries become invalid. To reflect this an additional method checks given the mutation result which queries must be invalidated
CommandEvent
All events associated with Command
CommandExecutedEvent
Event when the Command.execute method is called
CommandQueryInvalidationEvent
Event with Command.invalidate methods queries.
Composer
The composer is a simple dumb function that fetches data from multiple queries This interface is the way you need to interact with your queries from a ComposerRuntime
CompositionContainerCreatedEvent
When a new CompositionContainer is created due to a subscription to it.
CompositionContainerDisposedEvent
When an existing CompositionContainer is disposed.
CompositionContainerListenerRemovedEvent
When a listener is removed form a CompositionContainer.
CompositionContainerNewListenerEvent
When a CompositionContainer get a new listener
CompositionEvent
Events associated with Composition lifecycle
CompositionExecutedEvent
When the Composition.execute method is called.
CompositionRefreshEvent
when the Notifier refresh method is called.
CompositionSetStateEvent
When the Composition.execute method calls CompositionContainer.setState
CompositionSettledEvent
When the Composition.execute method notifies that it is settled: CompositionContainer.isSettled.
CompositionUnsubscribeEvent
when the CompositionManager.unsubscribe method is called
CompositionWatchEvent
When the Composition.execute method calls Composer.watch to watch a Query
Event
A base class for all events that can be emitted by the world. It contains the common properties of all events, such as the time of the event and the name of the component that emitted the event.
FutureQuery<T>
A base class for queries that are based on a Future. It handles the common logic of managing the AsyncValue state and the cancellation of the Future when the query is invalidated.
Mutation<C extends Composition>
The base class that defines all Mutations for a certain Composition
MutationCommandDispatchedEvent
When a Mutation execution dispatches a Command through the Commander
MutationContainerCreatedEvent
When a MutationContainer is created
MutationEvent
All events relating Mutation
MutationExecutedEvent
When a Mutation method is being ran by a Notifier
MutationInvalidationEvent
After a Mutation Execution is finished and it is invalidating Querys
MutationQueryReadEvent
When a Mutation execution reads a Query
Observer
A base class for all observers that can be added to the world. It defines the common interface for all observers
Query<T>
A query defines an interface where T is the return type of the query and a method that can construct it from it's own definition. Aside from that it should also define an initial state
QueryContainerCreatedEvent
Specific event for the creation of a query container.
QueryContainerDisposedEvent
Specific event for the disposal of a query container.
QueryContainerListenerRemovedEvent
Specific event for the removal of a listener from a query container.
QueryContainerNewListenerEvent
Specific event for the addition of a new listener to a query container.
QueryEvent
Events related to the execution and lifecycle of queries. These events are emitted by the QueryManager
QueryExecutedEvent
Specific event for the execution of a query.
QueryInvalidatedEvent
Specific event for the invalidation of a query. A query is invalidated when it needs to be re-executed, for example, a command explicitly invalidates a query after mutating the state
QuerySetStateEvent
Specific event for the update of the state of a query.
QuerySettledEvent
Specific event for the settling of a query. A query is considered settled when it has finished executing and its state is stable.
StreamQuery<T>
A base class for queries that are based on a Stream. It handles the common logic of managing the AsyncValue state and the cancellation of the Stream subscription when the query is invalidated
SynchronousComposition<T>
A base class for compositions that are based on a synchronous computation. It handles the common logic of managing the state and the execution of the composition when the composition container is executed or invalidated
SynchronousQuery<T>
A base class for queries that are based on a synchronous computation. It handles the common logic of managing the state and the execution of the query when the query container is executed or invalidated
ViewBuildEvent
Specific event for the build of a view. It is emitted when a ViewWidget is built.
ViewCreatedEvent
Specific event for the creation of a view. It is emitted when a new ViewWidget is created.
ViewDisposedEvent
Specific event for the disposal of a view. It is emitted when a ViewWidget is disposed.
ViewEvent
Events related to the lifecycle of a ViewWidget
ViewWidget<T, C extends Composition<T>, M extends Mutation<C>>
A base class for view widgets. It handles the common logic of subscribing to the Composition and running Mutations. It also defines the build method that will be called to build the widget based on the composition state and the notifier.
World
The world is the context where all the application state lives in. It is responsible for managing the lifecycle of the state, and providing a way to access it from the views and the view models. The world is created with a list of WorldPlugins that can be used to extend the functionality of the world, and a list of Observers that can be used to observe the events in the world.
WorldCreatedEvent
specific event for the creation of the world. It is emitted when a new world is created.
WorldDestroyedEvent
specific event for the destruction of the world. It is emitted when the world is destroyed, for example, when the app is killed.
WorldEvent
Events related to the lifecycle of the world. These events are emitted when the world is created, destroyed or settled.
WorldPlugin
A base class for all plugins that can be added to the world
WorldSettledEvent
specific event for the settling of the world. The world is considered settled when it has finished processing all the pending commands, queries, etc., and its state is stable.

Properties

commandLog → Logger
Logger for Command execution and invalidation.
final
compositionLog → Logger
Logger for CompositionManager operations.
final
mutationLog → Logger
Logger for Mutation definition events.
final
queryLog → Logger
Logger for QueryManager operations (subscriptions, invalidations).
final
viewLog → Logger
Logger for ViewWidget lifecycle and rendering events.
final
worldLog → Logger
Logger for World lifecycle events (settling, disposal).
final
yasmlLog → Logger
Root logger for all yasml events.
final

Typedefs

MutationConstructor<M extends Mutation<Composition>> = M Function(Commander commander)
A function that creates a Mutation from a Commander
MutationDefinition<M extends Mutation<Composition>, R> = FutureOr<R> Function(M mutation)
A user defined function that uses an instance Mutation to return R.
MutationRunner<M extends Mutation<Composition>> = Future<R> Function<R>(MutationDefinition<M, R> definition)
A function that sets up the context so that the passed MutationDefinition can be ran.
Notifier<M extends Mutation<Composition>> = ({Future<void> Function() refresh, MutationRunner<M> runMutation})
The notifier exposes the following functions to the view: