0.1.0 • Published 10 years ago

simple-memo v0.1.0

Weekly downloads
4
License
MIT
Repository
github
Last release
10 years ago

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.