MCPcopy Index your code
hub / github.com/Effect-TS/effect / runPromise

Function runPromise

packages/effect/src/Micro.ts:4265–4277  ·  view source on GitHub ↗
(
  effect: Micro<A, E>,
  options?: {
    readonly signal?: AbortSignal | undefined
    readonly scheduler?: MicroScheduler | undefined
  } | undefined
)

Source from the content-addressed store, hash-verified

4263 * @category execution
4264 */
4265export const runPromise = <A, E>(
4266 effect: Micro<A, E>,
4267 options?: {
4268 readonly signal?: AbortSignal | undefined
4269 readonly scheduler?: MicroScheduler | undefined
4270 } | undefined
4271): Promise<A> =>
4272 runPromiseExit(effect, options).then((exit) => {
4273 if (exit._tag === "Failure") {
4274 throw exit.cause
4275 }
4276 return exit.value
4277 })
4278
4279/**
4280 * Attempt to execute the `Micro` effect synchronously and return the `MicroExit`.

Callers 1

patch.tsFile · 0.50

Calls 1

runPromiseExitFunction · 0.70

Tested by

no test coverage detected