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

Function program

packages/effect/test/Sink/collecting.test.ts:221–233  ·  view source on GitHub ↗
(chunkSize: number)

Source from the content-addressed store, hash-verified

219 it.effect("collectAllWhileWith - example 1", () =>
220 Effect.gen(function*() {
221 const program = (chunkSize: number) =>
222 pipe(
223 Stream.fromChunk(Chunk.range(1, 10)),
224 Stream.rechunk(chunkSize),
225 Stream.run(pipe(
226 Sink.sum,
227 Sink.collectAllWhileWith({
228 initial: -1,
229 while: (n) => n === n,
230 body: (acc, curr) => acc + curr
231 })
232 ))
233 )
234 const result1 = yield* (program(1))
235 const result2 = yield* (program(3))
236 const result3 = yield* (program(20))

Callers 1

collecting.test.tsFile · 0.85

Calls 2

pipeFunction · 0.50
runMethod · 0.45

Tested by

no test coverage detected