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

Function fromPromise

packages/core/execution/src/promise.ts:63–65  ·  view source on GitHub ↗
(try_: () => Promise<A>)

Source from the content-addressed store, hash-verified

61 * carry the tagged error as the rejected value), so we re-orphan it as a defect.
62 */
63const fromPromise = <A>(try_: () => Promise<A>): Effect.Effect<A> =>
64 // oxlint-disable-next-line executor/no-effect-escape-hatch -- boundary: Promise executor facade has already erased the SDK typed error channel
65 Effect.tryPromise({ try: try_, catch: (cause) => cause }).pipe(Effect.orDie);
66
67// ---------------------------------------------------------------------------
68// wrapPromiseExecutor — adapt the v2 Promise `Executor` back into an Effect

Callers 1

wrapPromiseExecutorFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected