turbodombuilder - v0.9.5
    Preparing search index...

    Function cache

    • Parameters

      • Optionaloptions: CacheOptions = {}

        Optional caching options.

      Returns <Type extends object, Value>(
          value:
              | {
                  get?: (this: Type) => Value;
                  set?: (this: Type, value: Value) => void;
              }
              | ((this: Type, ...args: any[]) => any)
              | ((this: Type) => Value),
          context:
              | ClassMethodDecoratorContext<Type, (this: Type, ...args: any) => any>
              | ClassGetterDecoratorContext<Type, Value>
              | ClassAccessorDecoratorContext<Type, Value>,
      ) => any

      Stage-3 cache decorator:

      • When used on a method, it will cache the return value per arguments.
      • When used on a getter, it will cache its value once per instance.
      • When used on an accessor, it will wrap the getter similar to a cached getter.