code: function on (eventType, handler) {
      const eventTypes = getEventTypes(eventType)
      if (!eventTypes.length) throw new Error(`Unsupported window event type "${eventType}".`)
      eventTypes.forEach(type => handlersByEvent[type].push(handler))
      return off.bind({}, eventType, handler)
    }
docs: Event Handling