November: Procrastination Month

    component-event

    0.2.0 • Public • Published

    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

    Install

    npm i component-event

    DownloadsWeekly Downloads

    109,956

    Version

    0.2.0

    License

    none

    Last publish

    Collaborators

    • defunctzombie
    • dfcreative
    • tootallnate
    • tjholowaychuk
    • rauchg
    • retrofox
    • coreh
    • forbeslindesay
    • kelonye
    • mattmueller
    • yields
    • anthonyshort
    • ianstormtaylor
    • cristiandouce
    • swatinem
    • stagas
    • amasad
    • juliangruber
    • calvinfo
    • dominicbarnes
    • jongleberry
    • nami-doc
    • jonathanong
    • clintwood
    • thehydroimpulse
    • stephenmathieson
    • trevorgerhardt
    • timaschew
    • hughsk