bus 0.0.2 copy "bus: ^0.0.2" to clipboard
bus: ^0.0.2 copied to clipboard

outdatedDart 1 only

A light-weight event bus implementing the pub-sub pattern.

Event Bus on Dart #

A light-weight event bus library for Dart implementing the pub-sub pattern.

Usage #

A simple usage example:

import 'package:bus/bus.dart';

class Event {
  final DateTime timestamp;

  Event() : this.timestamp = new DateTime.now();
}

main() async {
  // Create a new bus.
  var bus = new Bus<Event>();

  bus.subscribe((Event event) {
    print('An event occurred at ${event.timestamp}.');
  });

  await bus.post(new Event());
}

Features and bugs #

Please file feature requests and bugs at the issue tracker.

0
likes
0
pub points
0%
popularity

Publisher

unverified uploader

A light-weight event bus implementing the pub-sub pattern.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

More

Packages that depend on bus