MCPcopy
hub / github.com/facebook/react / retainCache

Function retainCache

packages/react-reconciler/src/ReactFiberCacheComponent.js:90–100  ·  view source on GitHub ↗
(cache: Cache)

Source from the content-addressed store, hash-verified

88}
89
90export function retainCache(cache: Cache) {
91 if (__DEV__) {
92 if (cache.controller.signal.aborted) {
93 console.warn(
94 'A cache instance was retained after it was already freed. ' +
95 'This likely indicates a bug in React.',
96 );
97 }
98 }
99 cache.refCount++;
100}
101
102// Cleanup a cache instance, potentially freeing it if there are no more references
103export function releaseCache(cache: Cache) {

Calls

no outgoing calls

Tested by

no test coverage detected