repo_description: Lazy load your component, image or anything matters the performance.
repo_topics: lazyload react
code: "use strict";
  
  Object.defineProperty(exports, "__esModule", {
    value: true
  });
  exports.on = on;
  exports.off = off;
  function on(el, eventName, callback, opts) {
    opts = opts || false;
    if (el.addEventListener) {
      el.addEventListener(eventName, callback, opts);
    } else if (el.attachEvent) {
      el.attachEvent("on" + eventName, function (e) {
        callback.call(el, e || window.event);
      });
    }
  }
  
  function off(el, eventName, callback, opts) {
    opts = opts || false;
    if (el.removeEventListener) {
      el.removeEventListener(eventName, callback, opts);
    } else if (el.detachEvent) {
      el.detachEvent("on" + eventName, callback);
    }
  }