decord/source/5498_useReactiveSharedValue.js

54 lines
1.3 KiB
JavaScript
Raw Normal View History

2026-08-06 08:05:19 +00:00
// Module ID: 5498
// Function ID: 5499
2026-07-29 08:29:29 +00:00
// Name: useReactiveSharedValue
2026-08-06 08:05:19 +00:00
// Dependencies: [19, 1634]
2026-07-29 08:29:29 +00:00
// Exports: useReactiveSharedValue
2026-08-06 08:05:19 +00:00
// Module 5498 (useReactiveSharedValue)
2026-07-29 08:29:29 +00:00
import noop from "noop";
let c3;
let obj1;
({ useEffect: obj1, useRef: c3 } = noop);
2026-08-04 21:03:28 +00:00
export const useReactiveSharedValue = (obj) => {
2026-07-29 08:29:29 +00:00
const tmp = callback2(null);
const tmp2 = callback2(null);
const require = tmp2;
2026-08-04 21:03:28 +00:00
let tmp3 = obj;
if (obj) {
tmp3 = typeof obj === "object";
2026-07-29 08:29:29 +00:00
}
if (tmp3) {
2026-08-04 21:03:28 +00:00
tmp3 = "value" in obj;
2026-07-29 08:29:29 +00:00
}
if (!tmp3) {
if (null === tmp2.current) {
2026-08-04 21:03:28 +00:00
tmp.current = obj;
if (typeof obj === "object") {
2026-08-06 08:05:19 +00:00
obj = require(1634) /* cancelAnimation */;
2026-07-29 08:29:29 +00:00
obj = {};
2026-08-04 21:03:28 +00:00
const merged = Object.assign(obj);
2026-07-29 08:29:29 +00:00
let mutable = obj.makeMutable(obj);
} else {
2026-08-06 08:05:19 +00:00
mutable = require(1634) /* cancelAnimation */.makeMutable(obj);
const obj3 = require(1634) /* cancelAnimation */;
2026-07-29 08:29:29 +00:00
}
tmp2.current = mutable;
2026-08-04 21:03:28 +00:00
} else if (tmp.current !== obj) {
tmp2.current.value = obj;
2026-07-29 08:29:29 +00:00
}
}
callback(() => () => {
if (ref.current) {
outer1_0(outer1_1[1]).cancelAnimation(tmp.current);
const obj = outer1_0(outer1_1[1]);
}
}, []);
2026-08-04 21:03:28 +00:00
let current = tmp2.current;
if (current == null) {
current = obj;
}
2026-07-29 08:29:29 +00:00
return current;
};