Vue hooks that throttle.
import { useThrottle, useThrottleFn, useState } from 'vue-next-use';
const Demo = {
setup(){
const throttledValue = useThrottle(value);
// const throttledValue = useThrottleFn(value => value, 200);
return () => (
<>
<div>Value: {value}</div>
<div>Throttled value: {throttledValue}</div>
</>
);
}
};
useThrottle(value, ms?: number);
useThrottleFn(fn, ms, args);