import { customRef as a } from "vue";
function m(n, o = 16.67) {
  let l = n, r = !1, e = null;
  return a((s, f) => {
    const u = (t) => {
      if (t !== l) {
        if (r) {
          e = t;
          return;
        }
        l = t, f(), r = !0, setTimeout(() => {
          if (r = !1, e !== null) {
            const i = e;
            e = null, u(i);
          }
        }, o);
      }
    };
    return {
      get() {
        return s(), l;
      },
      set(t) {
        u(t);
      }
    };
  });
}
export {
  m as useThrottleRef
};
