Skip to main content
Module

x/async_channels/src/channel.ts>Channel#forEach

Inspired by Go & Clojure Channels, async_channels provides channels as an asynchronous communication method between asynchronous functions.
Latest
method Channel.prototype.forEach
import { Channel } from "https://deno.land/x/async_channels@v1.0.0-rc8/src/channel.ts";

forEach applies fn to each value in this channel, and returns a channel that will contain the results. The returned channel will close after this channel closes (or if the provided signal is triggered).

Parameters

fn: (val: T) => unknown | Promise<unknown>
optional
pipeOpts: ChannelPipeOptions