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

Function readIntsN

packages/effect/test/Channel/reading.test.ts:148–157  ·  view source on GitHub ↗
(
        n: number
      )

Source from the content-addressed store, hash-verified

146 5
147 )
148 const readIntsN = (
149 n: number
150 ): Channel.Channel<number, number, never, unknown, string, unknown> =>
151 n > 0
152 ? Channel.readWith({
153 onInput: (i: number) => pipe(Channel.write(i), Channel.flatMap(() => readIntsN(n - 1))),
154 onFailure: () => Channel.succeed("EOF"),
155 onDone: () => Channel.succeed("EOF")
156 })
157 : Channel.succeed("end")
158
159 const sum = (
160 label: string,

Callers 1

reading.test.tsFile · 0.85

Calls 2

writeMethod · 0.65
pipeFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…