1.1.3 • Published 4 days ago
@squeep/lazy-property v1.1.3
Lazy Property
Easily defer property initialization until first access.
lazy(obj, name, initializer, descriptor, objectBound = true)
const { lazy } = require('@squeep/lazy-property');
const obj = {};
lazy(obj, 'prop', () => doSomethingExpensive());
const getItNow = obj.prop;