sabre/event 2.0 release
We just released sabre/event 2.0.0. This releases adds a few features, and also slightly alters the API.
New stuff
- Support for promises.
- The event handler is now faster. This is especially noticable when making a lot of subscriptions to a single event, and is likely unnoticable for most.
- Added support for something called the 'continue callback' to to the
EventEmitter. This makes it possible to implement something similar to
javascript's
preventDefault
. - When calling removeAllListeners without an argument, all listeners for all events are removed.
Api breaks
- We switched to PSR-4 for autoloading.
- EventEmitter::listeners() no longer returns a manipulatable array of event listeners by reference. It's not a simple list of callbacks, sorted by their priority. The original concept was good on paper.
- The argument on
removeAllListeners
is now optional.
Upgrade sabre/event by making sure your composer.json references ~2.0.0
, and
then run:
composer update sabre/event
Full changelog can be found on Github