INNER CODE UNIT · JavaScript
Lazy
dotnet-websharper/core · src/compiler/WebSharper.Core.JavaScript/Runtime.js:12
export function Lazy(factory) {
var instance;
function getInstance() {
if (!instance) {
instance = factory(i => instance = i);
}
return instance;
}
let res = new Proxy(function () { }, {
get(_, key) {
if (key == forceSymbol) {
getInstance();
}
return getInstance()[key];
},
set(_, key, value) {
getInstance()[key] = value;
return true;