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

Function eventuallyTryScrollingTo

app/utils/url-hash-polyfill.js:126–143  ·  view source on GitHub ↗
(owner, url)

Source from the content-addressed store, hash-verified

124const CACHE = new WeakMap();
125
126async function eventuallyTryScrollingTo(owner, url) {
127 // Prevent quick / rapid transitions from continuing to observer beyond their URL-scope
128 CACHE.get(owner)?.disconnect();
129
130 if (!url) return;
131
132 let [, hash] = url.split('#');
133
134 if (!hash) return;
135
136 await waitForPromise(uiSettled(owner));
137
138 if (isDestroyed(owner) || isDestroying(owner)) {
139 return;
140 }
141
142 scrollToHash(hash);
143}
144
145const TIME_SINCE_LAST_MUTATION = 500; // ms
146const MAX_TIMEOUT = 2000; // ms

Callers 2

setupHashSupportFunction · 0.85
handleHashIntentFunction · 0.85

Calls 2

uiSettledFunction · 0.85
scrollToHashFunction · 0.85

Tested by

no test coverage detected