@ng-doc/builder
Version:
<!-- PROJECT LOGO --> <br /> <div align="center"> <a href="https://github.com/ng-doc/ng-doc"> <img src="https://ng-doc.com/assets/images/ng-doc.svg?raw=true" alt="Logo" height="150px"> </a>
19 lines • 786 B
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.CachedProperty = CachedProperty;
const cached_props_initializer_1 = require("../cached-props-initializer");
/**
* Decorator for cached properties, it will add the property name to the cachedProperties set
* @param accessor - Accessor for the cached property, it will be used to get and set the property value in the cache
*/
function CachedProperty(accessor) {
return (target, context) => {
context.addInitializer(function () {
(0, cached_props_initializer_1.cachedPropsInitializer)(this, context.name.toString(), accessor);
});
return function (initialValue) {
return initialValue;
};
};
}
//# sourceMappingURL=cached-property.js.map
;