0a5ab058a6
- Angular 12 application with PrimeNG components - 5 existing Cypress e2e test suites - SCSS styling with BEM naming convention - i18n support (10 languages) - Leaflet map integration - Complete component hierarchy and routing structure This baseline will be used for Angular → React migration.
19 lines
429 B
JavaScript
19 lines
429 B
JavaScript
export default function defineLazyProperty(object, propertyName, valueGetter) {
|
|
const define = value => Object.defineProperty(object, propertyName, {value, enumerable: true, writable: true});
|
|
|
|
Object.defineProperty(object, propertyName, {
|
|
configurable: true,
|
|
enumerable: true,
|
|
get() {
|
|
const result = valueGetter();
|
|
define(result);
|
|
return result;
|
|
},
|
|
set(value) {
|
|
define(value);
|
|
}
|
|
});
|
|
|
|
return object;
|
|
}
|