Skip to content

Higher level event management for abstract event handling mechanisms

Notifications You must be signed in to change notification settings

component/event-manager

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

EventManager

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.

Installation

$ component install component/event-manager

API

EventManager()

Initialize an EventManager with the given target object which events will be bound to, and the obj which will receive method calls.

EventManager.onbind(fn:Function)

Register bind function.

EventManager.onunbind(fn:Function)

Register unbind function.

EventManager.bind(event:String, [method]:String)

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')

EventManager.unbind([event]:String, [method]:String)

Unbind a single binding, all bindings for event, or all bindings within the manager.

  evennts.unbind('login', 'onLogin')
  evennts.unbind('login')
  evennts.unbind()

License

MIT

About

Higher level event management for abstract event handling mechanisms

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •