Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

forEach

import { forEach } from "https://github.gh-proxy.cn/raw.githubusercontent.com/baetheus/fun/main/async_iterable.ts";

Execute side effects for each value in an AsyncIterable.

@example
import { forEach } from "./async_iterable.ts";
import { fromIterable } from "./async_iterable.ts";

const numbers = fromIterable([1, 2, 3, 4, 5]);
await forEach(
  (n) => console.log(`Processing: ${n}`),
  () => console.log("Done!")
)(numbers);
function forEach<A>(onValue: (a: A) => unknown | PromiseLike<unknown>, onDone?: () => unknown | PromiseLike<unknown>): (ta: AsyncIterable<A>) => PromiseLike<void>;
§
forEach<A>(onValue: (a: A) => unknown | PromiseLike<unknown>, onDone?: () => unknown | PromiseLike<unknown>): (ta: AsyncIterable<A>) => PromiseLike<void>
[src]

§Type Parameters

§Parameters

§
onValue: (a: A) => unknown | PromiseLike<unknown>
[src]
§
onDone?: () => unknown | PromiseLike<unknown> optional
[src]

§Return Type

§
(ta: AsyncIterable<A>) => PromiseLike<void>
[src]