Mediator.create constructor

Mediator.create({
  1. List<EventObserver> observers = const [],
  2. DispatchStrategy defaultDispatchStrategy = const DispatchStrategy.concurrent(),
})

Creates a default Mediator.

observers can be provided to observe events dispatched.

defaultDispatchStrategy defines the strategy used when dispatching events.

Implementation

factory Mediator.create({
  List<EventObserver> observers = const [],
  DispatchStrategy defaultDispatchStrategy =
      const DispatchStrategy.concurrent(),
}) {
  return Mediator(
    eventManager: EventManager.create(
      defaultDispatchStrategy: defaultDispatchStrategy,
      observers: observers,
    ),
    requestManager: RequestManager.create(),
  );
}