MCPcopy Create free account
hub / github.com/Lucifier129/react-lite / memoizeStringOnly

Function memoizeStringOnly

examples/simple/react.js:18530–18538  ·  view source on GitHub ↗

* Memoizes the return value of a function that accepts one string argument. * * @param {function} callback * @return {function}

(callback)

Source from the content-addressed store, hash-verified

18528 * @return {function}
18529 */
18530function memoizeStringOnly(callback) {
18531 var cache = {};
18532 return function (string) {
18533 if (!cache.hasOwnProperty(string)) {
18534 cache[string] = callback.call(this, string);
18535 }
18536 return cache[string];
18537 };
18538}
18539
18540module.exports = memoizeStringOnly;
18541},{}],150:[function(_dereq_,module,exports){

Callers 1

react.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected