simple-memoizer

Memoize own method

simple-memoizer

Install the module with: npm install simple-memoizer

And it requires Proxy methods. So you need to add '--harmony-proxies' option (or '--harmony' if you use coffee-script).

var SM = require('simple-memoizer');
var memoized = new SM();
 
memoized.method = function() {
  var value = 5 * 5;
  console.log('calculated');
  return value;
}
 
memoized.method();
// calculated 
// 25 
memoized.method();
// 25 

(Coming soon)

(Coming soon)

(Coming soon)

(Nothing yet)

Copyright (c) 2013 Masami Yonehara Licensed under the MIT license.