UNPKG

@slan-health/taro-vueuse

Version:

taro vue版本hooks

17 lines (16 loc) 434 B
import { ref, watch } from "vue"; import useDebounceFn from "../useDebounceFn/index.js"; function refDebounce(value, ms = 200, options = {}) { if (ms <= 0) return value; const throttled = ref(value.value); const updater = useDebounceFn(() => { throttled.value = value.value; }, ms, options); watch(value, () => updater()); return throttled; } export { refDebounce as default }; //# sourceMappingURL=index.js.map