X-Git-Url: http://git.squeep.com/?p=squeep-lazy-property;a=blobdiff_plain;f=README.md;fp=README.md;h=10f677c34d1d12d41a3211d5afd063d377745da5;hp=0000000000000000000000000000000000000000;hb=7e55eb8f04aaa7d0d6a6c3de90313153a40800af;hpb=cde5aaf728595e10c50041e8b6deafe53f6b3eda diff --git a/README.md b/README.md new file mode 100644 index 0000000..10f677c --- /dev/null +++ b/README.md @@ -0,0 +1,13 @@ +# Lazy Property + +Easily defer property initialization until first access. + +`lazy(obj, name, initializer, descriptor, objectBound = true)` + +```js +const { lazy } = require('@squeep/lazy-property'); + +const obj = {}; +lazy(obj, () => doSomethingExpensive()); +const getItNow = obj.prop; +```