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

Function settleLayout

perf/app/layout.mjs:127–142  ·  view source on GitHub ↗
(expected)

Source from the content-addressed store, hash-verified

125}
126
127export async function settleLayout(expected) {
128 let previous;
129 let stable = 0;
130 let start = performance.now();
131 while (performance.now() - start < 15000) {
132 await new Promise(requestAnimationFrame);
133 let layout = readLayout(expected);
134 let signature = layout && layoutSignature(layout);
135 stable = signature && signature === previous ? stable + 1 : 1;
136 previous = signature;
137 if (signature && stable >= 3) {
138 return layout;
139 }
140 }
141 throw new Error('The variable-height viewport did not reach a complete, stable layout.');
142}

Callers

nothing calls this directly

Calls 2

readLayoutFunction · 0.85
layoutSignatureFunction · 0.85

Tested by

no test coverage detected