kuma
Lazy properties for Objects!
kuma creates lazy properties for Objects which get evaluated & cached the first time they are accessed. This is an easy way to delay going over the wire for an async value, or running an inline function!
Example
const kuma = ;let x = {}; ;xabc; // "foo" <- string has been cachedxabc; // "foo" <- accessed the cached valuexabc = "bar"; // <- cleared the cached value, & resultxabc; // "bar" <- string has been cached // Creating a lazy `Promise` via `fetch()`, re-executing this would clear a cached `Promise`; // Access the property later; it'll be cached until `x.github` is overriddenxgithub;
How can I load kuma?
kuma supports AMD loaders (require.js, curl.js, etc.), node.js & npm (npm install kuma), or using a script tag.
License
Copyright (c) 2016 Jason Mulligan Licensed under the BSD-3 license.