Create a lazily evaluated value
Useful when a value is expensive to generate, so you want to delay the computation until the value is needed. For example, improving startup performance by deferring nonessential operations.
$ npm install lazy-value
import lazyValue from 'lazy-value';
const value = lazyValue(() => expensiveComputation());
app.on('user-action', () => {
doSomething(value());
});
Type: Function
Expected to return a value.