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

Function check

perf/app/measure.ts:215–244  ·  view source on GitHub ↗
(layoutReady = false)

Source from the content-addressed store, hash-verified

213}
214
215function check(layoutReady = false) {
216 if (
217 !sample ||
218 !armed ||
219 finishing ||
220 (armed.layout && !layoutReady) ||
221 !matches(armed.conditions)
222 ) {
223 return;
224 }
225 finishing = true;
226 sample.semanticReady = performance.now();
227 // This is a rendering-opportunity proxy, not a claim about presented pixels.
228 // Waiting two frames also keeps a commit observed inside rAF from ending early.
229 requestAnimationFrame(() =>
230 requestAnimationFrame(() => {
231 if (sample) {
232 sample.renderingOpportunity = performance.now();
233 cancelAnimationFrame(frame);
234 if (marking) {
235 performance.measure('bench:ready', {start: sample.start, end: sample.semanticReady});
236 performance.measure('bench:window', {
237 start: sample.start,
238 end: sample.renderingOpportunity
239 });
240 }
241 }
242 })
243 );
244}
245
246function observe(records: MutationRecord[] = []) {
247 if (sample && !sample.renderingOpportunity) {

Callers 2

observeFunction · 0.85
tickFunction · 0.85

Calls 1

matchesFunction · 0.85

Tested by

no test coverage detected