INNER CODE UNIT · JavaScript

Force

dotnet-websharper/core · src/compiler/WebSharper.Core.JavaScript/Runtime.js:10

export function Force(obj) { obj[forceSymbol] }

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) {

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…