decord/source/1523_useLazyValue.js

18 lines
368 B
JavaScript
Raw Normal View History

2026-08-15 05:55:55 +00:00
// Module ID: 1523
// Function ID: 1524
2026-08-06 08:05:19 +00:00
// Name: useLazyValue
// Dependencies: [19]
// Exports: useLazyValue
2026-08-15 05:55:55 +00:00
// Module 1523 (useLazyValue)
2026-08-24 06:08:38 +00:00
import closure_0 from "noop" /* 19 */;
2026-08-06 08:05:19 +00:00
export const useLazyValue = function useLazyValue(arg0) {
const ref = React.useRef(undefined);
if (undefined === ref.current) {
ref.current = arg0();
}
return ref.current;
};