UNPKG

@cainiaofe/cn-ui-m

Version:
18 lines (17 loc) 433 B
import { canUseDom } from './can-use-dom'; export var supportsPassive = false; if (canUseDom) { try { var opts = {}; Object.defineProperty(opts, 'passive', { get: function () { supportsPassive = true; return supportsPassive; }, }); window.addEventListener('test-passive', null, opts); } catch (e) { console.error(e); } }