function subscribeToDebouncedResize(cb) {
  resizeSubscribers.push(cb);

  // if we go from zero to one Flexible components instances, add the listener
  if (resizeSubscribers.length === 1) {
    window.addEventListener('resize', debounceEmitResize);
  }
  return function unsubscribe() {
    removeSubscriber(cb);

    // if we have no Flexible components, remove the listener
    if (resizeSubscribers.length === 0) {
      window.clearTimeout(timeoutId);
      window.removeEventListener('resize', debounceEmitResize);
    }
  };
}
Add the given callback to the list of subscribers to be caled when the
window resizes. Returns a function that, when called, removes the given
callback from the list of subscribers. This function is also resposible for
adding and removing the resize listener on `window`.

@param {Function} cb - Subscriber callback function
@returns {Function} Unsubscribe function