MCPcopy Create free account
hub / github.com/hydro-dev/Hydro / checkResources

Function checkResources

packages/ui-default/components/DOMAttachedObject.ts:6–17  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

4const res = [];
5
6function checkResources() {
7 for (let i = res.length - 1; i >= 0; --i) {
8 if (res[i].detached || !document.body.contains(res[i].$dom[0])) {
9 if (!res[i].detached) res[i].detach();
10 res.splice(i, 1);
11 }
12 }
13 if (res.length === 0) {
14 clearInterval(removalChecker);
15 removalChecker = null;
16 }
17}
18
19function monitorResource(resource) {
20 res.push(resource);

Callers

nothing calls this directly

Calls 1

detachMethod · 0.45

Tested by

no test coverage detected