DEPRECATED: this module is no longer recommended, component/events now supports this functionality directly.
Higher level event management designed to facilitate fluent domain-specific event subscriptions.
For example component/events
uses EventManager
to provide fluent dom node event subsciptions,
while component/delegates
does the same, however for delegated events.
$ component install component/event-manager
- EventManager()
- EventManager.onbind()
- EventManager.onunbind()
- EventManager.bind()
- EventManager.unbind()
Initialize an EventManager
with the given
target
object which events will be bound to,
and the obj
which will receive method calls.
Register bind function.
Register unbind function.
Bind to event
with optional method
name.
When method
is undefined it becomes event
with the "on" prefix.
events.bind('login') // implies "onlogin"
events.bind('login', 'onLogin')
Unbind a single binding, all bindings for event
,
or all bindings within the manager.
evennts.unbind('login', 'onLogin')
evennts.unbind('login')
evennts.unbind()
MIT