Need private packages and team management tools?Check out npm Teams »

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.

Install

npm i simple-memo

DownloadsWeekly Downloads

0

Version

0.1.0

License

MIT

Last publish

Collaborators

  • avatar