events2 1.0.0 copy "events2: ^1.0.0" to clipboard
events2: ^1.0.0 copied to clipboard

Dart version of the event emitter.

pub package

dart-events #

Event emitter for dart2.

Usage #


import 'package:events2/events2.dart';

main() {
  EventEmitter event_emitter = new EventEmitter();

  event_emitter.on('event1', (arg0, String arg1, int arg2, arg3) {
    print('arg0 = ' + arg0 + ', arg1 = ' + arg1 + ', arg2 = ' + arg2.toString() + ', arg3 = ' + arg3.toString());
  });

  event_emitter.once('event2', () {
    print('event2 ');
  });
  
  event_emitter.emit('event1', 'a', 'b', null);
  event_emitter.emit('event2');
}

0
likes
130
points
2.56k
downloads

Publisher

unverified uploader

Weekly Downloads

Dart version of the event emitter.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

More

Packages that depend on events2