MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / loader

Function loader

packages/react/src/api/artifact-renderer.test.tsx:14–21  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

12const countingLoader = (options?: { readonly fail?: boolean }) => {
13 let calls = 0;
14 const loader: ArtifactRendererLoader = async () => {
15 calls += 1;
16 if (options?.fail) {
17 // oxlint-disable-next-line executor/no-try-catch-or-throw, executor/no-error-constructor -- boundary: simulating a bundler's failed dynamic import, which rejects with a plain Error
18 throw new Error("chunk unavailable");
19 }
20 return { default: (() => null) as never };
21 };
22 return {
23 loader,
24 calls: () => calls,

Callers 2

ensureLangFunction · 0.85
preloadArtifactRendererFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected