MCPcopy
hub / github.com/Effect-TS/effect / chainError

Function chainError

packages/effect/test/STM.test.ts:81–92  ·  view source on GitHub ↗
(depth: number)

Source from the content-addressed store, hash-verified

79}
80
81const chainError = (depth: number): Effect.Effect<never, number> => {
82 const loop = (_n: number, _acc: STM.STM<never, number, never>): Effect.Effect<never, number> => {
83 let n = _n
84 let acc = _acc
85 while (n > 0) {
86 acc = pipe(acc, STM.mapError((n) => n + 1))
87 n = n - 1
88 }
89 return STM.commit(acc)
90 }
91 return loop(depth, STM.fail(0))
92}
93
94const incrementTRefN = (n: number, ref: TRef.TRef<number>): Effect.Effect<number> =>
95 pipe(

Callers 1

STM.test.tsFile · 0.85

Calls 2

loopFunction · 0.70
failMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…