events_emitter 0.5.2 copy "events_emitter: ^0.5.2" to clipboard
events_emitter: ^0.5.2 copied to clipboard

An intuitive Event-based system, inspired by NodeJS's Event Emitter. Allows for multiple data types with type safety events. Based on JavaScript and suitable for Dart and Flutter.

example/lib/main.dart

// ignore_for_file: avoid_print

import 'package:events_emitter/events_emitter.dart';

void main() {
  final events = EventEmitter();

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

  events.emit('message', 'Hello World');
  events.emit('message', 42);

  // [Output]
  // String: Hello World
  // Integer: 42
}
17
likes
150
points
30.6k
downloads

Publisher

verified publisherdrafakiller.com

Weekly Downloads

An intuitive Event-based system, inspired by NodeJS's Event Emitter. Allows for multiple data types with type safety events. Based on JavaScript and suitable for Dart and Flutter.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

rxdart

More

Packages that depend on events_emitter