simple-memo
v0.1.0
Published
Simple memoization of function executions.
Downloads
1
Readme
simple-memo
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.