Open bugeats opened 4 years ago
It should work for named functions.
function caller( fn ) {
return fn();
}
function rand() {
return Math.random();
}
const mem = memoize( caller );
mem( rand ) === mem( rand ); // true
Can you post an example of what you're trying that doesn't seem to work?
Neat project. It doesn't seem to cache if a named function is used as a argument to the memoized function. Is this possible with WeakMap/Map?