@stembord/memoize
TypeScript icon, indicating that this package has built-in type declarations

0.1.2 • Public • Published

ts-memoize

memoize

import { memoize } from "@stembord/memoize";

const fac = memoize((x: number): number => (x === 0 ? 1 : x * fac(x - 1)));

fac(5); // 120
// this call will just return the previous result since the arguments are the same
fac(5); // 120

Readme

Keywords

Package Sidebar

Install

npm i @stembord/memoize

Weekly Downloads

2

Version

0.1.2

License

(MIT OR Apache-2.0)

Unpacked Size

18.1 kB

Total Files

13

Last publish

Collaborators

  • jwaterfaucett
  • nathanfaucett