Skip to main content

Function: eachConcur()

Returns an concur iterable equivalent to concurIterable that applies fn to each value of concurIterable as it is iterated.

The result of applying fn to a value is awaited before yielding.

Example

const eachedSloths = await pipe(
asConcur([`carl`, `frank`, `phil`]),
eachConcur(console.log),
reduceConcur(toArray()),
)
//=> carl
//=> frank
//=> phil

console.log(eachedSloths)
//=> [ 'carl', 'frank', 'phil' ]

eachConcur(fn)

eachConcur<Value>(fn): (concurIterable) => ConcurIterable<Value>

Returns an concur iterable equivalent to concurIterable that applies fn to each value of concurIterable as it is iterated.

The result of applying fn to a value is awaited before yielding.

Type Parameters

Value

Parameters

fn

Returns

Function

Parameters

concurIterable: ConcurIterable<Value>

Returns

ConcurIterable<Value>

Example

const eachedSloths = await pipe(
asConcur([`carl`, `frank`, `phil`]),
eachConcur(console.log),
reduceConcur(toArray()),
)
//=> carl
//=> frank
//=> phil

console.log(eachedSloths)
//=> [ 'carl', 'frank', 'phil' ]

Defined in

side-effects.d.ts:105

eachConcur(fn, concurIterable)

eachConcur<Value>(fn, concurIterable): ConcurIterable<Value>

Returns an concur iterable equivalent to concurIterable that applies fn to each value of concurIterable as it is iterated.

The result of applying fn to a value is awaited before yielding.

Type Parameters

Value

Parameters

fn

concurIterable: ConcurIterable<Value>

Returns

ConcurIterable<Value>

Example

const eachedSloths = await pipe(
asConcur([`carl`, `frank`, `phil`]),
eachConcur(console.log),
reduceConcur(toArray()),
)
//=> carl
//=> frank
//=> phil

console.log(eachedSloths)
//=> [ 'carl', 'frank', 'phil' ]

Defined in

side-effects.d.ts:108

eachConcur(fn)

eachConcur<From, To>(fn): (concurIterable) => ConcurIterable<To>

Returns an concur iterable equivalent to concurIterable that applies fn to each value of concurIterable as it is iterated.

The result of applying fn to a value is awaited before yielding.

Type Parameters

From

To

Parameters

fn

Returns

Function

Parameters

concurIterable: ConcurIterable<From>

Returns

ConcurIterable<To>

Example

const eachedSloths = await pipe(
asConcur([`carl`, `frank`, `phil`]),
eachConcur(console.log),
reduceConcur(toArray()),
)
//=> carl
//=> frank
//=> phil

console.log(eachedSloths)
//=> [ 'carl', 'frank', 'phil' ]

Defined in

side-effects.d.ts:113

eachConcur(fn, concurIterable)

eachConcur<From, To>(fn, concurIterable): ConcurIterable<To>

Returns an concur iterable equivalent to concurIterable that applies fn to each value of concurIterable as it is iterated.

The result of applying fn to a value is awaited before yielding.

Type Parameters

From

To

Parameters

fn

concurIterable: ConcurIterable<From>

Returns

ConcurIterable<To>

Example

const eachedSloths = await pipe(
asConcur([`carl`, `frank`, `phil`]),
eachConcur(console.log),
reduceConcur(toArray()),
)
//=> carl
//=> frank
//=> phil

console.log(eachedSloths)
//=> [ 'carl', 'frank', 'phil' ]

Defined in

side-effects.d.ts:116