MCPcopy Create free account
hub / github.com/QuarkGluonPlasma/react-course-code / fetchData

Function fetchData

suspense-error-boundary/src/App5.jsx:5–14  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

3
4let data, promise;
5function fetchData() {
6 if (data) return data;
7 promise = new Promise(resolve => {
8 setTimeout(() => {
9 data = '取到的数据'
10 resolve()
11 }, 2000)
12 })
13 throw promise;
14}
15
16function Content() {
17 const data = fetchData();

Callers 1

ContentFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected