@squeep/lazy-property

1.1.3 • Public • Published

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;

Readme

Keywords

Package Sidebar

Install

npm i @squeep/lazy-property

Weekly Downloads

2

Version

1.1.3

License

ISC

Unpacked Size

4.6 kB

Total Files

3

Last publish

Collaborators

  • thylacine