MCPcopy Create free account
hub / github.com/coolvasanth/reactjs_interview_preparation / fetchData

Function fetchData

src/EpamRound1/Excercise6.js:27–35  ·  view source on GitHub ↗
(object)

Source from the content-addressed store, hash-verified

25const cache = new WeakSet();
26
27function fetchData(object) {
28 if (cache.has(object)) {
29 // Data already cached for this object
30 } else {
31 // Fetch data and store it in cache with a weak reference to the object
32 cache.add(object);
33 // ... fetch and store data
34 }
35}
36
37/******************** Maps ********************/
38/**

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected