Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4821.js (118.4 MB)
35 lines
913 B
TypeScript
35 lines
913 B
TypeScript
// Module ID: 9783
|
|
// Function ID: 9784
|
|
// Name: useLeadingEdgeDebounce
|
|
// Dependencies: [32, 19, 2]
|
|
// Exports: useLeadingEdgeDebounce
|
|
|
|
// Module 9783 (useLeadingEdgeDebounce)
|
|
import _slicedToArray from "module_32" /* 32 */;
|
|
import noop from "module_19" /* 19 */;
|
|
|
|
const size = fn(2);
|
|
const result = size.fileFinishedImporting("hooks/useLeadingEdgeDebounce.tsx");
|
|
|
|
export const useLeadingEdgeDebounce = (arg0, arg1) => {
|
|
closure_0 = arg0;
|
|
closure_1 = arg1;
|
|
noop.useRef(true);
|
|
const tmp = _slicedToArray(noop.useState(arg0), 2);
|
|
closure_3 = tmp[1];
|
|
const items = [arg0, arg1];
|
|
const effect = noop.useEffect(() => {
|
|
const timeout = setTimeout(() => {
|
|
closure_1_3(closure_0);
|
|
ref.current = true;
|
|
}, closure_1);
|
|
if (ref.current) {
|
|
closure_3(timeout);
|
|
}
|
|
ref.current = false;
|
|
return () => {
|
|
clearTimeout(closure_0);
|
|
};
|
|
}, items);
|
|
return tmp[0];
|
|
};
|