@squeep/lazy-property
v1.1.3
Published
Defer property initialization calls until first access.
Downloads
7
Readme
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;