memoizefn-decorator-ts
v1.2.6
Published
Ts decorator memoization that caches the result of the different arguments.
Downloads
12
Maintainers
Readme
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();