[] (https://github.com/ThrusterIO/event-emitter/releases) [] (LICENSE) [] (https://travis-ci.org/ThrusterIO/event-emitter) [] (https://scrutinizer-ci.com/g/ThrusterIO/event-emitter) [] (https://scrutinizer-ci.com/g/ThrusterIO/event-emitter) [] (https://packagist.org/packages/thruster/event-emitter)
The Thruster EventEmitter Component.
Via Composer
$ composer require thruster/event-emitter
$emitter = new EventEmitter();
$emitter->on('foo.bar', function (Foo $bar) {
// ... Something happend
});
$emitter->emit('foo.bar', [$fooBar]);
$emitter = new AdvanceEventEmitter();
$emitter->on('foo.bar', function (EventInterface $event) {
// ... Do something good
$event->stopPropagation(); // you can stop further execution
});
$emitter->on('foo.bar', function (EventInterface $event) {
// ... Never gets called
});
$emitter->emit('foo.bar', new Event($fooBar));
$ composer test
Please see CONTRIBUTING and CONDUCT for details.
Please see License File for more information.