'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

var vue = require('vue');

function useDelayReset(timeout = 10) {
  const bool = vue.shallowRef(false);
  let delay;
  const cancelLatest = () => {
    clearTimeout(delay);
  };
  vue.onMounted(() => {
    cancelLatest();
  });
  const delaySetBool = (value, callback) => {
    cancelLatest();
    delay = setTimeout(() => {
      bool.value = value;
      if (callback)
        callback();
    }, timeout);
  };
  return [bool, delaySetBool, cancelLatest];
}

exports.default = useDelayReset;
//# sourceMappingURL=useDelayReset.cjs.map
