"use strict";
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
const vue = require("vue");
function useKeyRender(table) {
  let observer;
  const initWatchDom = () => {
    const columnsWrapper = table.vnode.el.querySelector(".hidden-columns");
    const config = {
      childList: true,
      subtree: true
    };
    const updateOrderFns = table.store.states.updateOrderFns;
    observer = new MutationObserver(() => {
      updateOrderFns.forEach((fn) => fn());
    });
    observer.observe(columnsWrapper, config);
  };
  vue.onMounted(() => {
    initWatchDom();
  });
  vue.onUnmounted(() => {
    observer == null ? void 0 : observer.disconnect();
  });
}
exports.default = useKeyRender;
