let passiveSupported = false
try {
  const options = Object.defineProperty({}, 'passive', {
    get() {
      passiveSupported = true
      return passiveSupported
    },
  })
  window.addEventListener('test', null, options)
} catch (err) {
  passiveSupported = false
}
// 添加事件
export function addEvent(target, event, handler, passive = false) {
  target.addEventListener(
    event,
    handler,
    passiveSupported ? { capture: false, passive } : false,
  )
}
// 移除事件
export function removeEvent(target, event, handler) {
  target.removeEventListener(event, handler)
}
