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

Function getData

packages/react-devtools-shared/src/__tests__/profilingCache-test.js:684–701  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

682 it('should calculate durations correctly for suspended views', async () => {
683 let data;
684 const getData = () => {
685 if (React.use) {
686 if (!data) {
687 data = new Promise(resolve => {
688 resolve('abc');
689 });
690 }
691 return React.use(data);
692 }
693 if (data) {
694 return data;
695 } else {
696 throw new Promise(resolve => {
697 data = 'abc';
698 resolve(data);
699 });
700 }
701 };
702
703 const Parent = () => {
704 Scheduler.unstable_advanceTime(10);

Callers 1

AsyncFunction · 0.70

Calls 1

resolveFunction · 0.50

Tested by

no test coverage detected