decord/source/5562_useRecyclingState.js

52 lines
1.2 KiB
JavaScript
Raw Normal View History

2026-08-05 07:35:12 +00:00
// Module ID: 5562
// Function ID: 5563
2026-07-29 08:29:29 +00:00
// Name: useRecyclingState
2026-08-05 07:35:12 +00:00
// Dependencies: [5496, 19, 5514]
2026-07-29 08:29:29 +00:00
// Exports: useRecyclingState
2026-08-05 07:35:12 +00:00
// Module 5562 (useRecyclingState)
2026-07-29 08:29:29 +00:00
import _slicedToArray from "_slicedToArray";
import noop from "noop";
let c3;
let c4;
let c5;
const require = arg1;
({ useCallback: c3, useMemo: c4, useRef: c5 } = noop);
export const useRecyclingState = function useRecyclingState(arg0, arg1, arg2) {
let tmp3;
const _require = arg0;
const dependencyMap = arg2;
let tmp = callback4(undefined);
const callback = tmp;
2026-08-05 07:35:12 +00:00
const obj = _require(5514);
[r10015, tmp3] = callback(_require(5514).useLayoutState(0), 2);
2026-07-29 08:29:29 +00:00
const callback2 = tmp3;
callback3(() => {
let tmpResult = closure_0;
2026-08-04 21:03:28 +00:00
if (typeof closure_0 === "function") {
2026-07-29 08:29:29 +00:00
tmpResult = tmp();
}
_slicedToArray.current = tmpResult;
if (closure_1 != null) {
tmp3();
}
}, arg1);
const items = [tmp3];
const items1 = [
tmp.current,
2026-08-04 21:03:28 +00:00
callback2((fn) => {
let tmp = fn;
if (typeof fn === "function") {
tmp = fn(tmp.current);
2026-07-29 08:29:29 +00:00
}
if (tmp !== tmp.current) {
tmp2.current = tmp;
arg1((arg0) => arg0 + 1, arg1);
}
}, items)
];
return items1;
};