eventable 5.2.1 copy "eventable: ^5.2.1" to clipboard
eventable: ^5.2.1 copied to clipboard

Dart 1 only

simple event system for implementing model->event->view design pattern.

example/eventable_example.dart

/**
 * Author:  Daniel Robinson http://github.com/0xor1
 */

library eventable.example;

import 'package:eventable/eventable.dart';

part 'bark.dart';
part 'cat.dart';
part 'dog.dart';

/**
 * trivial example just to show basic usage pattern
 */
void main(){

  var dog = new Dog();
  var cat = new Cat();

  cat.listen(dog, Bark, cat.dogBarkHandler);

  dog.bark(9);  // cat not disturbed
  dog.bark(11); // cat runs away

}
0
likes
35
pub points
0%
popularity

Publisher

unverified uploader

simple event system for implementing model->event->view design pattern.

Repository (GitHub)
View/report issues

License

MIT (license)

More

Packages that depend on eventable