Function
fromIterator
(iterator: LazyArg<Iterator<A, L>>)
Source from the content-addressed store, hash-verified
| 656 | * @since 4.0.0 |
| 657 | */ |
| 658 | export const fromIterator = <A, L>(iterator: LazyArg<Iterator<A, L>>): Channel<A, never, L> => |
| 659 | fromPull( |
| 660 | Effect.sync(() => { |
| 661 | const iter = iterator() |
| 662 | return Effect.suspend(() => { |
| 663 | const state = iter.next() |
| 664 | return state.done ? Cause.done(state.value) : Effect.succeed(state.value) |
| 665 | }) |
| 666 | }) |
| 667 | ) |
| 668 | |
| 669 | /** |
| 670 | * Creates a `Channel` that emits all elements from an array. |
Tested by
no test coverage detected