This commit is contained in:
janisslsm committed 2026-11-01 12:12:55 +02:00
1 parent 1781d25a15
commit 732c0ad767
33051 files changed
+2591613 -3019689

No files matched your search

+20
View File
@@ -0,0 +1,20 @@
// Metro module 10671 (f10672).
import { useRef, useState, useEffect } from "react";
export const useLeadingEdgeDebounce = (a0, a1) => {
const ref = useRef(true);
const [state, setState] = useState(a0);
useEffect(() => {
let c26788_0 = setTimeout(() => {
setState(a0);
ref.current = true;
}, a1);
if (ref.current) {
setState(a0);
}
ref.current = false;
return () => {
clearTimeout(c26788_0);
};
}, [a0, a1]);
return state;
};