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

Function getAsyncText

packages/react-reconciler/src/__tests__/ReactUse-test.js:68–82  ·  view source on GitHub ↗
(text)

Source from the content-addressed store, hash-verified

66 }
67
68 function getAsyncText(text) {
69 // getAsyncText is completely uncached — it performs a new async operation
70 // every time it's called. During a transition, React should be able to
71 // unwrap it anyway.
72 Scheduler.log(`Async text requested [${text}]`);
73 return new Promise(resolve => {
74 const requests = pendingTextRequests.get(text);
75 if (requests !== undefined) {
76 requests.push(resolve);
77 pendingTextRequests.set(text, requests);
78 } else {
79 pendingTextRequests.set(text, [resolve]);
80 }
81 });
82 }
83
84 function Text({text}) {
85 Scheduler.log(text);

Callers 7

AppFunction · 0.85
ReactUse-test.jsFile · 0.85
ChildFunction · 0.85
ExcitingTextFunction · 0.85
AsyncTextFunction · 0.85
renderMethod · 0.85
[Symbol.asyncIterator]Function · 0.85

Calls 3

setMethod · 0.80
getMethod · 0.65
pushMethod · 0.65

Tested by

no test coverage detected