Skip to main content

Function: forEachConcur()

Returns a promise that resolves when fn has been applied to each value of concurIterable and the result of each application has been awaited.

Like Array.prototype.forEach, but for concur iterables.

Example

const sloths = asConcur([`carl`, `frank`, `phil`])

await forEachConcur(console.log, sloths)
//=> carl
//=> frank
//=> phil
//

forEachConcur(fn)

forEachConcur<Value>(fn): (concurIterable) => Promise<void>

Returns a promise that resolves when fn has been applied to each value of concurIterable and the result of each application has been awaited.

Like Array.prototype.forEach, but for concur iterables.

Type Parameters

Value

Parameters

fn

Returns

Function

Parameters

concurIterable: ConcurIterable<Value>

Returns

Promise<void>

Example

const sloths = asConcur([`carl`, `frank`, `phil`])

await forEachConcur(console.log, sloths)
//=> carl
//=> frank
//=> phil
//

Defined in

side-effects.d.ts:195

forEachConcur(fn, concurIterable)

forEachConcur<Value>(fn, concurIterable): Promise<void>

Returns a promise that resolves when fn has been applied to each value of concurIterable and the result of each application has been awaited.

Like Array.prototype.forEach, but for concur iterables.

Type Parameters

Value

Parameters

fn

concurIterable: ConcurIterable<Value>

Returns

Promise<void>

Example

const sloths = asConcur([`carl`, `frank`, `phil`])

await forEachConcur(console.log, sloths)
//=> carl
//=> frank
//=> phil
//

Defined in

side-effects.d.ts:198