MCPcopy Create free account
hub / github.com/ember-learn/ember-api-docs / requestTimeCheck

Function requestTimeCheck

app/utils/url-hash-polyfill.js:168–191  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

166 let frame;
167
168 function requestTimeCheck() {
169 if (frame) cancelAnimationFrame(frame);
170
171 if (isDestroyed(owner) || isDestroying(owner)) {
172 return;
173 }
174
175 frame = requestAnimationFrame(() => {
176 totalTimeWaited = new Date().getTime() - timeStarted;
177
178 let timeSinceLastMutation = new Date().getTime() - lastMutationAt;
179
180 if (totalTimeWaited >= MAX_TIMEOUT) {
181 return resolve(totalTimeWaited);
182 }
183
184 if (timeSinceLastMutation >= TIME_SINCE_LAST_MUTATION) {
185 return resolve(totalTimeWaited);
186 }
187
188 // eslint-disable-next-line ember/no-runloop
189 schedule('afterRender', requestTimeCheck);
190 });
191 }
192
193 // eslint-disable-next-line ember/no-runloop
194 schedule('afterRender', requestTimeCheck);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected