category |
---|
Utilities |
Debounce execution of a function.
Debounce is an overloaded waiter: if you keep asking him your requests will be ignored until you stop and give him some time to think about your latest inquiry.
import { useDebounceFn } from '@vueuse/core'
const debouncedFn = useDebounceFn(() => {
// do something
}, 1000)
document.addEventListener('resize', debouncedFn)
useThrottle
useThrottleFn
useDebounce
useDebounceFn