Mediator

Component implements the Mediator pattern in a simple and effective way to make your projects extensible.

(Inspired by Symfony Event Dispatcher)

Pub version License Coverage Status

import 'package:mediator/mediator.dart';

main() async {
  var dispatcher = new EventDispatcher();
  
  dispatcher.addListener('event-name', (String eventName, Event event) async {
  	// ...
  });
  
  var event = await dispatcher.dispatch('event-name');
  
  if (event.isPropagationStopped) {
    // ...
  }
}

Libraries

mediator