import { struct as s } from "../../../utils/struct/main.js";
import { enumerable as o } from "../../../utils/struct/property.js";
const r = /* @__PURE__ */ Symbol("<<NO_EXCEPTION>>"), m = (n) => {
  const t = [];
  return s({
    bind: o((c) => function(...i) {
      let e = r;
      try {
        return t.push(c), c.call(this, ...i);
      } catch (l) {
        throw e = l;
      } finally {
        t.pop(), t.length === 0 && e === r && n();
      }
    }),
    effect: o(n)
  });
};
export {
  m as createEffectStack
};
