'use strict';

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

var vue = require('vue');

function useDebounce(value) {
  const cacheValue = vue.shallowRef(value.value.slice());
  let timeout = null;
  vue.watchEffect(() => {
    clearTimeout(timeout);
    timeout = setTimeout(
      () => {
        cacheValue.value = value.value;
      },
      value.value.length ? 0 : 10
    );
  });
  return cacheValue;
}

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