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

Function run

apps/cloud/src/web/components/admin-verification.tsx:84–93  ·  view source on GitHub ↗
(
    effect: Effect.Effect<A, VerificationError>,
    signal: AbortSignal,
    onSuccess: (value: A) => void,
  )

Source from the content-addressed store, hash-verified

82 const codeId = useId();
83
84 const run = async <A,>(
85 effect: Effect.Effect<A, VerificationError>,
86 signal: AbortSignal,
87 onSuccess: (value: A) => void,
88 ) => {
89 const exit = await Effect.runPromiseExit(effect, { signal });
90 if (signal.aborted) return;
91 if (Exit.isSuccess(exit)) onSuccess(exit.value);
92 else setError(Option.getOrNull(Cause.findErrorOption(exit.cause))?.message ?? unavailable);
93 };
94
95 useEffect(() => {
96 const owner = new AbortController();

Callers 2

loadFunction · 0.70
actFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected