mediatr library

Classes

ICommand<T extends Object?>
Extend ICommand instead of IRequest when you dont need to return anything.
ICommandHandler<R extends IRequest<void>>
Extend this class when you need to handle an ICommand that returns nothing.
IDomainEvent
Subclasses of IDomainEvent can be published through the mediator instance.
IEventHandler<E extends IDomainEvent>
Extend IEventHandler with E as the event you want to subscribe to
IPipelineBehavior<R extends IRequest, T>
IQuery<T extends Object>
Same thing as IRequest but required to return not null
IRequest<R>
The base IRequest check IQuery and ICommand if you want to be more specific about your actions.
IRequestHandler<T extends IRequest<R>, R>
Extend IRequestHandler with R as the return type and T as the IRequest you want to handle.
Mediator
Core mediator
Pipeline
A pipeline passes an IRequest through all of its middlewares before being send to the IRequestHandler

Typedefs

FuncEventHandler<T extends IDomainEvent> = FutureOr<void> Function(T event)
HandlerCreator<T> = T Function()
RequestHandlerDelegate<T> = Future<T> Function(IRequest<T> req)
UnsubscribeFunc = void Function()