@opensig/opendesign
Version:
17 lines (16 loc) • 335 B
JavaScript
import { nextTick } from "vue";
const useRunOnceNextTick = () => {
const tickJobs = /* @__PURE__ */ new Set();
return (fn) => {
if (tickJobs.size === 0) {
nextTick(() => {
tickJobs.forEach((item) => item());
tickJobs.clear();
});
}
tickJobs.add(fn);
};
};
export {
useRunOnceNextTick
};