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

Function fibonacci

packages/effect/test/Channel.test.ts:93–99  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

91 it.effect("fromIteratorArray", () =>
92 Effect.gen(function*() {
93 function* fibonacci(): Generator<number, void, unknown> {
94 let a = 0, b = 1
95 for (let i = 0; i < 5; i++) {
96 yield a
97 ;[a, b] = [b, a + b]
98 }
99 }
100 const result = yield* Channel.runCollect(
101 Channel.fromIteratorArray(() => fibonacci(), 3)
102 )

Callers 1

Channel.test.tsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected