decord/source/6953_useStableMemo.js

24 lines
534 B
JavaScript
Raw Normal View History

2026-08-13 07:00:46 +00:00
// Module ID: 6953
// Function ID: 6954
2026-07-20 16:05:17 +00:00
// Name: useStableMemo
2026-08-13 07:00:46 +00:00
// Dependencies: [19, 6954]
2026-07-20 16:05:17 +00:00
// Exports: default
2026-08-13 07:00:46 +00:00
// Module 6953 (useStableMemo)
2026-07-29 08:29:29 +00:00
import { useRef } from "noop";
2026-07-23 10:11:24 +00:00
2026-07-20 16:05:17 +00:00
let closure_3 = [];
export default function useStableMemo(arg0, items) {
const tmp = useRef();
const tmp2 = useRef(closure_3);
if (tmp2.current === closure_3) {
tmp.current = arg0();
tmp2.current = items;
2026-08-13 07:00:46 +00:00
} else if (!importDefault(6954)(items, tmp2.current)) {
2026-07-20 16:05:17 +00:00
tmp.current = arg0();
tmp2.current = items;
}
return tmp.current;
};