1.0.4 • Published 3 years ago

minimoize v1.0.4

Weekly downloads
10
License
ISC
Repository
-
Last release
3 years ago

minimoize

A very tiny (less than 100 lines!) yet powerful memoizer for JavaScript functions.

Installation

With script tag

<script src="https://unpkg.com/minimoize@1.0.4/dist/index.js"></script>

minimoize will be defined as global variable.

With ES modules

import minimoize from 'https://unpkg.com/minimoize@1.0.4/dist/index.mjs';

Usage

function fn(arg) {
  // my complex function
  return { hello: 'false', test: arg };
}

fn(1) === fn(1); // false ; different objects with same content

// > The magic <
fn = minimoize(fn);

// Now, fn will memoize depending args
fn(1) === fn(1); // true ; same objects
1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago