MCPcopy Index your code
hub / github.com/react/react / createCacheSeed

Function createCacheSeed

packages/react-devtools-shared/src/inspectedElementCache.js:58–72  ·  view source on GitHub ↗
(
  element: Element,
  inspectedElement: InspectedElementFrontend,
)

Source from the content-addressed store, hash-verified

56}
57
58function createCacheSeed(
59 element: Element,
60 inspectedElement: InspectedElementFrontend,
61): [CacheSeedKey, InspectedElementMap] {
62 const thenable: FulfilledThenable<InspectedElementFrontend> = {
63 then(callback: (value: any) => mixed, reject: (error: mixed) => mixed) {
64 callback(thenable.value);
65 },
66 status: 'fulfilled',
67 value: inspectedElement,
68 };
69 const map = createMap();
70 map.set(element, thenable);
71 return [createMap, map];
72}
73
74/**
75 * Fetches element props and state from the backend for inspection.

Callers 1

checkForUpdateFunction · 0.85

Calls 2

setMethod · 0.80
createMapFunction · 0.70

Tested by

no test coverage detected