/has-passive-events

Check if current device supports passive events

Primary LanguageJavaScriptMIT LicenseMIT

has-passive-events unstable Build Status

Check if event listener options are available on the current device. Try it out.

npm install has-passive-events

const hasPassive = require('has-passive-events')

hasPassive ? element.addEventListener('wheel', handler, {passive: true}) : element.addEventListener('wheel', handler)

If you find edge case, please address issues.