This is a basic event emitter for KDFramework.
After mixing in KDEventEmitter
to your class you can use class
and instance
level listeners.
class KDView
@include KDEventEmitter
...
KDView.on eventName, callback
KDView.once eventName, callback
KDView.off eventName # kills all listeners
KDView.emit eventName[, arg1[, arg2[, ...]]]
view = new KDView
view.on eventName, callback
view.once eventName, callback
view.off eventName # kills all listeners
view.emit eventName[, arg1[, arg2[, ...]]]
- @devrim - Devrim Yasar
- @sinan - Sinan Yasar
- @humanchimp - Chris Thorn