decord/source/5307_useReactiveSharedValue.js

54 lines
1.5 KiB
JavaScript
Raw Normal View History

2026-07-23 10:11:24 +00:00
// Module ID: 5307
// Function ID: 45810
2026-07-20 16:05:17 +00:00
// Name: useReactiveSharedValue
2026-07-23 10:11:24 +00:00
// Dependencies: [31, 1582]
2026-07-20 16:05:17 +00:00
// Exports: useReactiveSharedValue
2026-07-23 10:11:24 +00:00
// Module 5307 (useReactiveSharedValue)
import result from "result";
let closure_2;
let closure_3;
({ useEffect: closure_2, useRef: closure_3 } = result);
2026-07-20 16:05:17 +00:00
export const useReactiveSharedValue = function useReactiveSharedValue(INITIAL_CONTAINER_HEIGHT) {
let tmp = INITIAL_CONTAINER_HEIGHT;
const tmp2 = callback2(null);
const tmp3 = callback2(null);
const require = tmp3;
let tmp4 = INITIAL_CONTAINER_HEIGHT;
if (INITIAL_CONTAINER_HEIGHT) {
tmp4 = "object" === typeof tmp;
}
if (tmp4) {
tmp4 = "value" in tmp;
}
if (!tmp4) {
if (null === tmp3.current) {
tmp2.current = tmp;
if ("object" === typeof tmp) {
const _Object = Object;
2026-07-23 10:11:24 +00:00
let mutable = require(1582) /* cancelAnimation */.makeMutable(Object.assign({}, tmp));
const obj2 = require(1582) /* cancelAnimation */;
2026-07-20 16:05:17 +00:00
} else {
2026-07-23 10:11:24 +00:00
mutable = require(1582) /* cancelAnimation */.makeMutable(tmp);
let obj = require(1582) /* cancelAnimation */;
2026-07-20 16:05:17 +00:00
}
tmp3.current = mutable;
} else if (tmp2.current !== tmp) {
tmp3.current.value = tmp;
}
}
callback(() => () => {
2026-07-23 10:11:24 +00:00
if (outer1_0.current) {
callback(outer2_1[1]).cancelAnimation(outer1_0.current);
const obj = callback(outer2_1[1]);
2026-07-20 16:05:17 +00:00
}
}, []);
const current = tmp3.current;
if (null != current) {
tmp = current;
}
return tmp;
};