JSPM

simple-memo

0.1.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • 0
  • Score
    100M100P100Q23426F
  • License MIT

Simple memoization of function executions.

Package Exports

  • simple-memo

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (simple-memo) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

simple-memo Build Status

Simple memoization of function executions.

var memoize = require("simple-memo");
var wrapped = memoize(function (a, b) {
    return a + b;
});
wrapped("foo", "bar"); // returns computed "foobar"
wrapped("foo", "bar"); // returns cached "foobar"

You can customize the internal cache keys by passing a hasher callback to the exported function, but I'm not sure why you'd need to.