T-Event-Dispatcher
Allows to register subscribers and dispatch events across the application.
Usage
Simply create a class and put annotations on its methods:
;
Then use EventDispatcher class to dispatch events:
; require'./subscriber/UserEventSubscriber';// you can also require the whole directory using: Utils.requireAll([__dirname + '/subscriber']); ; eventDispatcher.dispatch'onUserCreate', new User'Johny';eventDispatcher.dispatch'onStatusUpdate', 'hello world';
Take a look on samples in ./sample
for more examples of usages.
Todos
- cover with tests
- more documentation