Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4759.js (118.4 MB)
38 lines
862 B
JavaScript
38 lines
862 B
JavaScript
// Module ID: 1505
|
|
// Function ID: 1506
|
|
// Dependencies: [19]
|
|
|
|
// Module 1505
|
|
import noop from "module_19" /* 19 */;
|
|
|
|
if (typeof document !== "undefined") {
|
|
let useEffect = noop.useLayoutEffect;
|
|
} else {
|
|
const _navigator = navigator;
|
|
if (typeof navigator !== "undefined") {
|
|
const _navigator2 = navigator;
|
|
}
|
|
useEffect = noop.useEffect;
|
|
}
|
|
|
|
export default function useLatestCallback(set) {
|
|
let current = set;
|
|
noop.useRef(set);
|
|
useEffect(() => {
|
|
closure_1.current = current;
|
|
});
|
|
return noop.useRef(function latestCallback() {
|
|
let length;
|
|
const items = [];
|
|
let num = 0;
|
|
if (0 < arguments.length) {
|
|
do {
|
|
items[num] = arguments[num];
|
|
num = num + 1;
|
|
length = arguments.length;
|
|
} while (num < length);
|
|
}
|
|
current = ref.current;
|
|
return current.apply(this, items);
|
|
}).current;
|
|
};
|