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

Function resolveText

packages/react-dom/src/__tests__/ReactDOMFizzServer-test.js:324–338  ·  view source on GitHub ↗
(text)

Source from the content-addressed store, hash-verified

322 }
323
324 function resolveText(text) {
325 const record = textCache.get(text);
326 if (record === undefined) {
327 const newRecord = {
328 status: 'resolved',
329 value: text,
330 };
331 textCache.set(text, newRecord);
332 } else if (record.status === 'pending') {
333 const thenable = record.value;
334 record.status = 'resolved';
335 record.value = text;
336 thenable.pings.forEach(t => t());
337 }
338 }
339
340 function rejectText(text, error) {
341 const record = textCache.get(text);

Callers 3

AFunction · 0.70
AppFunction · 0.70

Calls 4

setMethod · 0.80
getMethod · 0.65
forEachMethod · 0.65
tFunction · 0.50

Tested by

no test coverage detected