0.1.4 • Published 7 years ago

eventfish v0.1.4

Weekly downloads
15
License
MIT
Repository
github
Last release
7 years ago

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})