streamline library

Classes

AggregatorBuilder<TResponse>
Widget that executes an aggregator and builds UI based on its results.
CommandBuilder<TResponse>
Widget that executes a command and builds UI based on its result.
EventBuilder<T extends IEvent>
Widget that observes events of type T and builds UI based on the latest event.
IAction<TResult>
An action is a type that represents a ICommand, IQuery, IAggregator or IEvent.
IActionHandler<TAction extends IAction<TResult>, TResult>
A handler interface for processing actions of type TAction and producing results of type TResult.
IAggregator<TResult>
An aggregator is a type that represents a IAggregator, a message that have multiple handlers and all results are returned.
IAggregatorHandler<TAggregator extends IAggregator<TResult>, TResult>
An aggregator handler is a type that handles an IAggregator.
ICommand<TResult>
A command is a type that represents a ICommand.
ICommandHandler<TCommand extends ICommand<TResult>, TResult>
A command handler is a type that handles an ICommand.
IEvent
An event is something that happens in the application.
IEventHandler<TEvent extends IEvent>
A handler for events that implements the IActionHandler interface.
IQuery<TResult>
A query is a type that represents a IQuery.
IQueryHandler<TQuery extends IQuery<TResult>, TResult>
A handler for queries that implements the IActionHandler interface.
Mediator
Central mediator that manages dispatchers for different types of actions in the application.
MediatorConfig
Widget that configures and initializes the Mediator system.
None<TValue>
None is a type that does not contain a value.
Option<TValue>
A type that can be either Some or None.
QueryBuilder<TResponse>
Widget that executes a query and builds UI based on its result.
Some<TValue>
Some is a type that contains a value of type TValue.

Properties

$aggregate Future<List<TResult>> Function<TResult>(IAggregator<TResult> aggregator)
Processes an aggregator through all registered handlers and returns their results.
final
$aggregatorHandler → void Function<TActionType extends IAction<TResultType>, TResultType>(IActionHandler<TActionType, TResultType> handlerFactory())
Registers an aggregator handler factory for a specific IAggregator.
final
$commandHandler → void Function<TActionType extends IAction<TResultType>, TResultType>(IActionHandler<TActionType, TResultType> handlerFactory())
Registers a command handler factory for a specific ICommand.
final
$dispatch Future<TResult> Function<TResult>(ICommand<TResult> command)
Dispatches a command to its registered handler and returns the result.
final
$emit → void Function<TEvent extends IEvent>(TEvent event, {bool skipIfSameAsLastEmitted = true})
Emits an event to all registered handlers and observers.
final
$eventHandler → void Function<TActionType extends IAction<TResultType>, TResultType>(IActionHandler<TActionType, TResultType> handlerFactory())
Registers an event handler factory for a specific IEvent.
final
$eventObserver → void Function<TEvent extends IEvent>(EventObserver<TEvent> hook)
Registers an observer for a specific event type.
final
$eventStream → ValueStream<TEvent> Function<TEvent extends IEvent>()
Gets the stream of events for a specific event type.
final
$globalEventObserver → void Function<TEvent extends IEvent>(EventObserver<IEvent> hook)
Registers a global observer that receives all events.
final
$lastEmitted Option<TEvent> Function<TEvent extends IEvent>()
Gets the last emitted event of a specific type.
final
$queryHandler → void Function<TActionType extends IAction<TResultType>, TResultType>(IActionHandler<TActionType, TResultType> handlerFactory())
Registers a query handler factory for a specific IQuery.
final
$registerAggregatorBehaviour → void Function<TActionType extends IAction<TResultType>, TResultType>(Future<TResultType> behaviour(TActionType action, Future<TResultType> next(TActionType newAction)))
Register a pipeline behaviour.
final
$registerCommandBehaviour → void Function<TActionType extends IAction<TResultType>, TResultType>(Future<TResultType> behaviour(TActionType action, Future<TResultType> next(TActionType newAction)))
Register a pipeline behaviour.
final
$registerEventBehaviour → void Function<TActionType extends IAction<TResultType>, TResultType>(Future<TResultType> behaviour(TActionType action, Future<TResultType> next(TActionType newAction)))
Register a pipeline behaviour.
final
$registerGenericAggregatorBehaviour → void Function(Future behaviour(IAggregator action, Future next(IAggregator newAction)))
Register a pipeline behaviour.
final
$registerGenericCommandBehaviour → void Function(Future behaviour(ICommand action, Future next(ICommand newAction)))
Register a pipeline behaviour.
final
$registerGenericEventBehaviour → void Function(Future<void> behaviour(IEvent action, Future<void> next(IEvent newAction)))
Register a pipeline behaviour.
final
$registerGenericQueryBehaviour → void Function(Future behaviour(IQuery action, Future next(IQuery newAction)))
Register a pipeline behaviour.
final
$registerQueryBehaviour → void Function<TActionType extends IAction<TResultType>, TResultType>(Future<TResultType> behaviour(TActionType action, Future<TResultType> next(TActionType newAction)))
Register a pipeline behaviour.
final
$request Future<TResult> Function<TResult>(IQuery<TResult> query)
Requests a query to its registered handler and returns the result.
final

Functions

$subscribe<TEvent extends IEvent>(Future<void> handler(TEvent event)) StreamSubscription<TEvent>
Adds a subscription to this stream of IEvent.

Typedefs

AggregatorHandlerDelegate = IAggregatorHandler<IAggregator, dynamic> Function()
Type definition for an aggregator handler factory function.
CommandHandlerDelegate = ICommandHandler<ICommand, dynamic> Function()
Type definition for a command handler factory function.
EventHandlerDelegate = IEventHandler<IEvent> Function()
Type definition for an event handler factory function.
EventObserver<TEvent extends IEvent> = Option<TEvent> Function(TEvent event)
A function type that observes events and optionally transforms or filters them.
QueryHandlerDelegate = IQueryHandler<IQuery, dynamic> Function()
Type definition for a query handler factory function.