code: function addResizeListener (el, handler, dimensions = ['width']) {
    const node = findDOMNode(el)
    let origSize = getBoundingClientRect(node)
    let cancelled = false
    let raf
  
    const checkDimensions = () => {
      if (cancelled) {
        return
      }
  
      const boundingRect = getBoundingClientRect(node)
      const size = {
        width: boundingRect.width,
        height: boundingRect.height
      }
  
      if (dimensions.some((dim) => size[dim] != origSize[dim]) && typeof handler === 'function') {
        handler(size)
      }
  
      origSize = size
  
      raf = requestAnimationFrame(checkDimensions)
    }
  
    checkDimensions()
  
    return {
      remove () {
        cancelled = true
        raf.cancel()
      }
    }
  }
docs: TODO: replace with https://wicg.github.io/ResizeObserver/ when it's supported 
  ---
  category: utilities/DOM
  ---
  @module
  Adds a listener to an element and calls a specified handler
  function whenever the size changes
  
  @param {ReactComponent|DomNode} el - component or DOM node
  @param {function} handler - function to run when resize occurs
  @returns {function} remove - cancel the listener and no longer execute the handler function