component-event
Event binding component
Last updated 13 years ago by tootallnate .
Repository · Bugs · Original npm · Tarball · package.json
$ npm install component-event 
SYNC missed versions from official npm registry.

event

Element event binding component.

Installation

$ component install component/event

Example

var events = require('event');
var a = document.querySelector('a');

function onclick(e) {
  e.preventDefault();
  console.log(e.target);
  events.unbind(a, 'click', onclick);
}

events.bind(a, 'click', onclick);

API

.bind(el, type, callback, [capture])

Bind to el's event type with callback, returns the callback passed.

.unbind(el, type, callback, [capture])

Unbind el's event type callback, returns the callback passed.

License

MIT

Current Tags

  • 0.2.1                                ...           latest (4 years ago)

4 Versions

  • 0.2.1                                ...           4 years ago
  • 0.2.0                                ...           10 years ago
  • 0.1.4                                ...           13 years ago
  • 0.1.3                                ...           13 years ago
Maintainers (1)
Downloads
Total 14
Today 0
This Week 1
This Month 7
Last Day 0
Last Week 4
Last Month 0
Dependencies (0)
None
Dev Dependencies (0)
None
Dependents (2)

© 2010 - cnpmjs.org x YWFE | Home | YWFE