memoizefn-decorator-ts
TypeScript icon, indicating that this package has built-in type declarations

1.2.6 • Public • Published

Decorator_memoizeFn

Ts decorator memoization that caches the result of the different arguments.

Example:

import { Memoize } from "memoizefn-decorator-ts";

export class App {
  constructor() {
    console.log(this.some(3)); // calculated
    console.log(this.some(3)); // cached
    console.log(this.some(4)); // calculated
    console.log(this.some(4)); // cached
  }

  @Memoize()
  private some(n: number): number {
    return n + n;
  }
}

new App();

Package Sidebar

Install

npm i memoizefn-decorator-ts

Weekly Downloads

1

Version

1.2.6

License

ISC

Unpacked Size

7.51 kB

Total Files

13

Last publish

Collaborators

  • denirjr