Function
fromIterator
(iterator: LazyArg<Iterator<A, L>>)
Source from the content-addressed store, hash-verified
| 721 | * @since 4.0.0 |
| 722 | */ |
| 723 | export const fromIterator = <A, L>(iterator: LazyArg<Iterator<A, L>>): Channel<A, never, L> => |
| 724 | fromPull( |
| 725 | Effect.sync(() => { |
| 726 | const iter = iterator() |
| 727 | return Effect.suspend(() => { |
| 728 | const state = iter.next() |
| 729 | return state.done ? Cause.done(state.value) : Effect.succeed(state.value) |
| 730 | }) |
| 731 | }) |
| 732 | ) |
| 733 | |
| 734 | /** |
| 735 | * Creates a `Channel` that emits all elements from an array. |
Tested by
no test coverage detected