What is wrong with this?
Requires inheritance to dispatch events
Need to subclass Event to pass around data
String references as events rather than objects
Misses basic functionality (remove all listeners etc.)
What does AS3Signals do?
Uses composition over inheritance
Doesn’t require subclassing to pass arguments
Listeners subscribe to Objects not a String reference
Can hook up to native Events
Most lightweight Signal class
Passes any number of arguments
Supports optional strong typing for arguments
Similar to the NativeSignal class
Has its own dispatch code rather than IEventDispatcher
Integration with frameworks
removeAll - removes all listeners to a signal
addOnce - ﬁres a signal event only the ﬁrst time
numListeners - returns how many listeners for a signal
There is experimental event bubbling support
How well does it perform?
zero listeners one listener
Where can you get it?
Feel free to get in touch!