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

Function createServerData

fixtures/ssr2/server/render.js:75–96  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

73// We fake this because the streaming HTML renderer
74// is not yet integrated with real data fetching strategies.
75function createServerData() {
76 let done = false;
77 let promise = null;
78 return {
79 read() {
80 if (done) {
81 return;
82 }
83 if (promise) {
84 throw promise;
85 }
86 promise = new Promise(resolve => {
87 setTimeout(() => {
88 done = true;
89 promise = null;
90 resolve();
91 }, API_DELAY);
92 });
93 throw promise;
94 },
95 };
96}

Callers 1

render.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected