Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4823.js (118.4 MB)
47 lines
1.2 KiB
JavaScript
47 lines
1.2 KiB
JavaScript
// Module ID: 4408
|
|
// Function ID: 4409
|
|
// Dependencies: [19]
|
|
// Exports: useDisposableMemo
|
|
|
|
// Module 4408
|
|
import noop from "module_19" /* 19 */;
|
|
|
|
({ useRef: closure_0, useEffect: closure_1 } = noop);
|
|
let deps = Symbol("UNINITIALIZED");
|
|
|
|
export const useDisposableMemo = function useDisposableMemo(fn2, _temp, items, current2) {
|
|
const obj = { value: "r", deps, pendingDisposal: null };
|
|
const tmp2 = React(obj);
|
|
closure_0 = tmp2;
|
|
const obj2 = React(_temp);
|
|
obj2.current = _temp;
|
|
const tmp3 = React(current2);
|
|
deps = tmp3;
|
|
tmp3.current = current2;
|
|
if (tmp2.current.deps === deps) {
|
|
if (tmp2.current.deps !== deps) {
|
|
if (tmp3.current) {
|
|
tmp3.current.current = undefined;
|
|
}
|
|
try {
|
|
obj2.current(tmp2.current.value);
|
|
} catch (err) {
|
|
}
|
|
}
|
|
const obj3 = { value: fn2(), deps: items, pendingDisposal: null };
|
|
tmp2.current = obj3;
|
|
if (tmp3.current) {
|
|
tmp3.current.current = tmp2.current.value;
|
|
}
|
|
}
|
|
framebus(() => () => {
|
|
if (ref3.current) {
|
|
ref3.current.current = undefined;
|
|
}
|
|
try {
|
|
ref2.current(ref.current.value);
|
|
} catch (err) {
|
|
}
|
|
}, []);
|
|
return tmp2.current.value;
|
|
};
|