MCPcopy Create free account
hub / github.com/adobe/react-spectrum / read

Function read

perf/app/measure.ts:375–402  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

373 return !!sample?.renderingOpportunity;
374 },
375 read(): Sample {
376 if (!sample?.renderingOpportunity) {
377 throw new Error('Measurement did not complete');
378 }
379 if (!armed || !matches(armed.conditions)) {
380 throw new Error('The expected result did not remain correct after completion');
381 }
382 if (armed.layout) {
383 let layout = readLayout(armed.layout);
384 if (!layout || layoutSignature(layout) !== layoutSignature(sample.layout)) {
385 throw new Error('The variable-height layout changed after completion.');
386 }
387 }
388 collect((observer?.takeRecords() ?? []) as EventEntry[]);
389 collectFrames((frameObserver?.takeRecords() ?? []) as LongFrameEntry[]);
390 return {
391 ...sample,
392 events: events.filter(
393 event => event.startTime >= sample!.start && event.startTime <= sample!.renderingOpportunity
394 ),
395 // A frame that began before the input event can still contain its handling.
396 longFrames: longFrames.filter(
397 frame =>
398 frame.startTime + frame.duration >= sample!.start &&
399 frame.startTime <= sample!.renderingOpportunity
400 )
401 };
402 }
403};

Callers

nothing calls this directly

Calls 6

readLayoutFunction · 0.90
layoutSignatureFunction · 0.90
matchesFunction · 0.85
collectFramesFunction · 0.85
collectFunction · 0.70
filterMethod · 0.65

Tested by

no test coverage detected