are-passive-events-supported
TypeScript icon, indicating that this package has built-in type declarations

1.1.1 • Public • Published

are-passive-events-supported

Check if the browser supports passive event listeners.

Example

import arePassiveEventsSupported from 'are-passive-events-supported'
 
window.addEventListener(
  'touchstart',
  () => {
    console.log('touchstart')
  },
  arePassiveEventsSupported() ? { passive: true } : undefined,
)

Similar projects

/are-passive-events-supported/

    Package Sidebar

    Install

    npm i are-passive-events-supported

    Weekly Downloads

    64,639

    Version

    1.1.1

    License

    MIT

    Unpacked Size

    5.05 kB

    Total Files

    8

    Last publish

    Collaborators

    • andarist