eventfish

0.1.4 • Public • Published

EventFish

Cast your net on a root element and catch all event matching selectors on your watch list.

var net = new EventFish(document.body)

net.addWatchList('click', 'div.capture', function(e){
  console.log('this div got clicked')
})

net.addWatchList('click', 'a.capture', function(e){
  // this will fail silently because passive listener by default
  // for performance reason
  e.preventDefault()
  console.log('this a got clicked and preventDefault ignored')
})

// to preventDefault
new EventFish(document.body, {passive: false})

Readme

Keywords

none

Package Sidebar

Install

npm i eventfish

Weekly Downloads

274

Version

0.1.4

License

MIT

Last publish

Collaborators

  • magi.ks