Socket
Socket
Sign inDemoInstall

lazy-value

Package Overview
Dependencies
0
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    lazy-value

Create a lazily evaluated value


Version published
Weekly downloads
808
increased by7.45%
Maintainers
1
Install size
4.28 kB
Created
Weekly downloads
 

Readme

Source

lazy-value

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.

Install

$ npm install lazy-value

Usage

import lazyValue from 'lazy-value';

const value = lazyValue(() => expensiveComputation());

app.on('user-action', () => {
	doSomething(value());
});

API

lazyValue(fn)

fn

Type: Function

Expected to return a value.

  • define-lazy-prop - Define a lazily evaluated property on an object
  • import-lazy - Import a module lazily
  • p-lazy - Create a lazy promise

Keywords

FAQs

Last updated on 08 Apr 2021

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc