MCPcopy Create free account
hub / github.com/Lobos/react-ui / memoizeStringOnly

Function memoizeStringOnly

docs/lib/react.js:19108–19116  ·  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

19106 */
19107
19108function memoizeStringOnly(callback) {
19109 var cache = {};
19110 return function (string) {
19111 if (!cache.hasOwnProperty(string)) {
19112 cache[string] = callback.call(this, string);
19113 }
19114 return cache[string];
19115 };
19116}
19117
19118module.exports = memoizeStringOnly;
19119},{}],163:[function(_dereq_,module,exports){

Callers 1

react.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…