Project Init

This commit is contained in:
Muluhabt
2026-05-29 15:23:46 +03:00
commit 2fbc557aac
67387 changed files with 6063341 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
'use client';
import { useState, useRef, useEffect } from 'react';
import { useThrottledCallbackWithClearTimeout } from '../use-throttled-callback/use-throttled-callback.mjs';
function useThrottledValue(value, wait) {
const [throttledValue, setThrottledValue] = useState(value);
const valueRef = useRef(value);
const [throttledSetValue, clearTimeout] = useThrottledCallbackWithClearTimeout(
setThrottledValue,
wait
);
useEffect(() => {
if (value !== valueRef.current) {
valueRef.current = value;
throttledSetValue(value);
}
}, [throttledSetValue, value]);
useEffect(() => clearTimeout, []);
return throttledValue;
}
export { useThrottledValue };
//# sourceMappingURL=use-throttled-value.mjs.map