MCPcopy Create free account
hub / github.com/AlloyTeam/PhyTouch / memoizeStringOnly

Function memoizeStringOnly

transformjs/react/example/index.js:12584–12592  ·  view source on GitHub ↗

* Memoizes the return value of a function that accepts one string argument.

(callback)

Source from the content-addressed store, hash-verified

12582 */
12583
12584 function memoizeStringOnly(callback) {
12585 var cache = {};
12586 return function (string) {
12587 if (!cache.hasOwnProperty(string)) {
12588 cache[string] = callback.call(this, string);
12589 }
12590 return cache[string];
12591 };
12592 }
12593
12594 module.exports = memoizeStringOnly;
12595

Callers 1

index.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected