0.1.0 • Published 10 years ago
simple-memo v0.1.0
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.
0.1.0
10 years ago