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

0.1.4 • Public • Published

ts-memoize

memoize

import { memoize } from "@aicacia/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 @aicacia/memoize

Weekly Downloads

1

Version

0.1.4

License

(MIT OR Apache-2.0)

Unpacked Size

79.2 kB

Total Files

28

Last publish

Collaborators

  • nathanfaucett