Creates a sink handing every item to a consumer.
The feed is drained without retaining any item, making this the sink of choice for pipes run for their side effects rather than for a collected result.
The type of items in the feed
The function processing each item; a returned promise is awaited before the next item is pulled, so items are processed one at a time
A sink resolving to the number of items handed to consumer
consumer
await pipe( (items(1, 2, 3)) (forEach(n => console.log(n)))); // logs 1, 2, 3; 3 Copy
await pipe( (items(1, 2, 3)) (forEach(n => console.log(n)))); // logs 1, 2, 3; 3
Creates a sink handing every item to a consumer.
The feed is drained without retaining any item, making this the sink of choice for pipes run for their side effects rather than for a collected result.