(owner, url)
| 124 | const CACHE = new WeakMap(); |
| 125 | |
| 126 | async 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 | |
| 145 | const TIME_SINCE_LAST_MUTATION = 500; // ms |
| 146 | const MAX_TIMEOUT = 2000; // ms |
no test coverage detected