Nocturnally Psychologizing Millipede
    Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

    component-delegatepublic

    delegate

    Low-level event delegation component.

    Installation

    $ component install component/delegate
    

    Example

    var delegate = require('delegate');
    var ul = document.querySelector('ul');
    var n = 0;
     
    var fn = delegate.bind(ul, 'li a', 'click', function(e){
      console.log(e.target);
      console.log(e.delegateTarget); // => "<a>"
      if (++== 3) {
        console.log('unbind');
        delegate.unbind(ul, 'click', fn, false);
      }
    }, false);

    API

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

    Bind and return a callback which may be passed to .unbind().

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

    Unbind.

    License

    MIT

    install

    npm i component-delegate

    Downloadsweekly downloads

    1,084

    version

    0.2.4

    license

    none

    repository

    githubgithub

    last publish

    collaborators

    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar