Socket
Book a DemoInstallSign in
Socket

event-component

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

event-component

Event binding component

latest
npmnpm
Version
0.1.0
Version published
Maintainers
1
Created
Source

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

Keywords

event

FAQs

Package last updated on 19 Dec 2012

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts