simple-memo

0.1.0 • Public • Published

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.

Package Sidebar

Install

npm i simple-memo

Weekly Downloads

0

Version

0.1.0

License

MIT

Last publish

Collaborators

  • evocateur