47 lines
1.2 KiB
JavaScript
47 lines
1.2 KiB
JavaScript
// Module ID: 5801
|
|
// Function ID: 5802
|
|
// Name: useRecyclingState
|
|
// Dependencies: [5735, 19, 5753]
|
|
// Exports: useRecyclingState
|
|
|
|
// Module 5801 (useRecyclingState)
|
|
import closure_2 from "_slicedToArray" /* 5735 */;
|
|
import noop from "noop" /* 19 */;
|
|
|
|
const require = arg1;
|
|
({ useCallback: c3, useMemo: c4, useRef: c5 } = noop);
|
|
|
|
export const useRecyclingState = function useRecyclingState(arg0, arg1, arg2) {
|
|
const _require = arg0;
|
|
dependencyMap = arg2;
|
|
let tmp = callback4(undefined);
|
|
const callback = tmp;
|
|
const obj = _require(5753);
|
|
[r10015, tmp3] = callback(_require(5753).useLayoutState(0), 2);
|
|
const callback2 = tmp3;
|
|
callback3(() => {
|
|
let tmpResult = closure_0;
|
|
if (typeof closure_0 === "function") {
|
|
tmpResult = tmp();
|
|
}
|
|
closure_2.current = tmpResult;
|
|
if (closure_1 != null) {
|
|
tmp3();
|
|
}
|
|
}, arg1);
|
|
const items = [tmp3];
|
|
const items1 = [
|
|
tmp.current,
|
|
callback2((fn) => {
|
|
let tmp = fn;
|
|
if (typeof fn === "function") {
|
|
tmp = fn(ref.current);
|
|
}
|
|
if (tmp !== ref.current) {
|
|
tmp2.current = tmp;
|
|
arg1((arg0) => arg0 + 1, arg1);
|
|
}
|
|
}, items)
|
|
];
|
|
return items1;
|
|
};
|