import { defaultIfEmpty } from 'rxjs/operators' ; import { lastValueFrom } from '../rxjs_7' ; import { mapWithLimit$ } from './observable' ; import { IterableInput , AsyncMapFn } from './types' ; param iterable param fn export async function asyncForEach < T > ( iterable , fn ) { await lastValueFrom ( mapWithLimit$ ( iterable , Infinity , fn ) . pipe ( defaultIfEmpty ( ) ) ) ; } param iterable param limit param fn export async function asyncForEachWithLimit < T > ( iterable , limit , fn ) { await lastValueFrom ( mapWithLimit$ ( iterable , limit , fn ) . pipe ( defaultIfEmpty ( ) ) ) ; }