@webdeveric/utils
    Preparing search index...

    Function lazyProp

    • Create a property descriptor that lazily computes its value.

      Type Parameters

      • Key extends PropertyKey
      • Value

      Parameters

      Returns TypedPropertyDescriptor<Value>

      const data = {};

      Object.defineProperty(data, 'value', lazyProp('value', () => {
      return Math.random();
      }));