MCPcopy Create free account
hub / github.com/heygen-com/hyperframes / settle

Function settle

packages/core/src/runtime/compositionLoader.ts:152–162  ·  view source on GitHub ↗
(status: "load" | "error" | "timeout")

Source from the content-addressed store, hash-verified

150 const startedAt = Date.now();
151 let timeoutId: number | null = null;
152 const settle = (status: "load" | "error" | "timeout") => {
153 if (settled) return;
154 settled = true;
155 if (timeoutId != null) {
156 window.clearTimeout(timeoutId);
157 }
158 resolve({
159 status,
160 elapsedMs: Math.max(0, Date.now() - startedAt),
161 });
162 };
163 scriptEl.addEventListener("load", () => settle("load"), { once: true });
164 scriptEl.addEventListener("error", () => settle("error"), { once: true });
165 timeoutId = window.setTimeout(() => settle("timeout"), EXTERNAL_SCRIPT_LOAD_TIMEOUT_MS);

Callers 3

handleErrorFunction · 0.85
isPortAvailableOnHostFunction · 0.85

Calls 2

resolveFunction · 0.85
nowMethod · 0.80

Tested by

no test coverage detected