RestrictedEventEmitter constructor

RestrictedEventEmitter({
  1. Set<String>? allow,
  2. Set<String>? disallow,
  3. int? maxListeners,
})

RestrictedEventEmitter

RestrictedEventEmitter events = RestrictedEventEmitter(allow: { 'message', 'data', 'error' }, maxListeners: 3);

events.on('message', (String data) => print('String: $data'));
events.on('message', (int data) => print('Integer: $data'));

Implementation

RestrictedEventEmitter({this.allow, this.disallow, this.maxListeners});