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

1.0.1 • Public • Published

Memoizer

This repository is a basic Memoizer implementation.

Memoization is best technique to save on memory or CPU cycles when we deal with repeated operations.

Basically, if the function is called with the same inputs, Memoizer helps directly return the result in the cache.

Here, i use a popular npm package memoizee.

Install

npm i @aya_ab/memoize
yarn add @aya_ab/memoize

Example

import { memoize } from "./memoize";
...
class MyClass {
  @memoize()
  myFunction(a = undefined, b = undefined, c = undefined) {
    var result = a + " " + b + " " + c;
    this.helloFunc();
    return result;
  }
  helloFunc() {}
}
...

Test

npm run test

Readme

Keywords

Package Sidebar

Install

npm i @aya_ab/memoize

Weekly Downloads

2

Version

1.0.1

License

ISC

Unpacked Size

13.3 kB

Total Files

15

Last publish

Collaborators

  • aya_ab