New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

@code-workers.io/ts-memoize

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@code-workers.io/ts-memoize

A lightweight utility library to memoize function calls

latest
Source
npmnpm
Version
1.0.2
Version published
Maintainers
1
Created
Source

@code-workers.io/ts-memoize

Library providing memoization functionality via:

  • a memoize-function
  • a Memoize-decorator

Installation

npm i @code-workers.io/ts-memoize

Usage

Decorator Usage

Annotate the function you want to memoize using the Memoize-decorator:

class Test {
  @Memoize()
  calculate(a: number, b: number): number {
    return a + b;
  }
}

Function usage

Use the memoize-function:

class Test {
  calc(a: number, b: number): number {
    return memoize((a, b) => a + b).memoized(a, b);
  }
}

Keywords

memoize

FAQs

Package last updated on 28 Nov 2022

Did you know?

Socket

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