@bodil/core
    Preparing search index...

    Function cache

    • Decorate a getter to cache its result.

      Useful for deferring initialisation of a property until first access. Instead of myProperty = new Thing();, use @cache get myProperty() { return new Thing(); }.

      Type Parameters

      • C extends object
      • T

      Parameters

      Returns (this: C) => T