'use strict';

Object.defineProperty(exports, "__esModule", {
    value: true
});
var addEventListener = function addEventListener(target, eventType, callback) {
    if (target.addEventListener) {
        target.addEventListener(eventType, callback, true);

        return {
            remove: function remove() {
                target.removeEventListener(eventType, callback, true);
            }
        };
    } else if (target.attachEvent) {
        target.attachEvent('on' + eventType, callback);

        return {
            remove: function remove() {
                target.detachEvent('on' + eventType, callback);
            }
        };
    }
};

exports.default = addEventListener;