'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

var supportsPassive = require('../../_util/supportsPassive.js');

function addEventListenerWrap(target, eventType, cb, option) {
  if (target && target.addEventListener) {
    let opt = option;
    if (opt === void 0 && supportsPassive.default && (eventType === "touchstart" || eventType === "touchmove" || eventType === "wheel"))
      opt = { passive: false };
    target.addEventListener(eventType, cb, opt);
  }
  return {
    remove: () => {
      if (target && target.removeEventListener)
        target.removeEventListener(eventType, cb);
    }
  };
}

exports.default = addEventListenerWrap;
//# sourceMappingURL=addEventListener.js.map
