• Performs the given action for all items of the async iterable.

    Type Parameters

    • T

    Parameters

    • it: AsyncIterable<any>
    • action: ((item, i?) => T)
        • (item, i?): T
        • Parameters

          • item: any
          • Optional i: number

          Returns T

    Returns Promise<void>

    Example

    import { forEachAsync } from 'deleight/generators';
    async function* asyncGen() {
    yield *range(10);
    }
    forEachAsync(asyncGen(), ()=> console.log(i));