MCPcopy Create free account
hub / github.com/Effect-TS/effect / runCodec

Function runCodec

packages/effect/src/ui/internal/codecRun.ts:14–25  ·  view source on GitHub ↗
(
  effect: Effect.Effect<A, E>
)

Source from the content-addressed store, hash-verified

12
13/** @internal */
14export const runCodec = <A, E>(
15 effect: Effect.Effect<A, E>
16): Exit.Exit<A, E> | Fiber.Fiber<A, E> => {
17 const exit = Effect.runSyncExit(effect)
18 if (Exit.isFailure(exit)) {
19 const defect = Cause.findDefect(exit.cause)
20 if (Result.isSuccess(defect) && Cause.isAsyncFiberError(defect.success)) {
21 return defect.success.fiber as Fiber.Fiber<A, E>
22 }
23 }
24 return exit
25}
26
27const warned = new WeakMap<object, Set<string>>()
28

Callers 6

decodeOfFunction · 0.90
decodeFunction · 0.90
instanceFunction · 0.90
saveFunction · 0.90
keepHeldFunction · 0.90
laterFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected