code: function addListener(element, listener) {
          var listeners = getState(element).listeners;
  
          if (!listeners.push) {
              throw new Error("Cannot add listener to an element that is not detectable.");
          }
  
          getState(element).listeners.push(listener);
      }
docs: Adds a resize event listener to the element.
  @public
  @param {element} element The element that should have the listener added.
  @param {function} listener The listener callback to be called for each resize event of the element. The element will be given as a parameter to the listener callback.