/* "use client" */

import { useEffect } from 'react';
var useResize = function useResize(callback) {
  var immediatelyInvoke = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  useEffect(function () {
    var fn = function fn() {
      return callback();
    };
    if (immediatelyInvoke) {
      fn();
    }
    window.addEventListener('resize', fn);
    return function () {
      return window.removeEventListener('resize', fn);
    };
  }, []);
};
export default useResize;