// src/js-tools/js-utils/browser/ui-utils.ts
import debounce from "lodash-es/debounce";
function observeResize(elem, callback, options = { debounce: 66 }) {
  const resizeObserver = new ResizeObserver(
    debounce(callback, options.debounce)
  );
  callback();
  resizeObserver.observe(elem);
  return () => {
    resizeObserver.disconnect();
  };
}

export {
  observeResize
};
