Skip to main content

Function: minByConcur()

Returns a concur iterable containing a minimum value of concurIterable based on the fn AsyncCompare function if concurIterable contains at least one value. Otherwise, returns an empty concur iterable.

Example

console.log(
await pipe(
asConcur([`eating`, `sleeping`, `yawning`]),
minByConcur((a, b) => a.length - b.length),
getConcur,
),
)
//=> eating

minByConcur(fn, concurIterable)

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

Returns a concur iterable containing a minimum value of concurIterable based on the fn AsyncCompare function if concurIterable contains at least one value. Otherwise, returns an empty concur iterable.

Type Parameters

Value

Parameters

fn: AsyncCompare<Value>

concurIterable: ConcurIterable<Value>

Returns

ConcurIterable<Value>

Example

console.log(
await pipe(
asConcur([`eating`, `sleeping`, `yawning`]),
minByConcur((a, b) => a.length - b.length),
getConcur,
),
)
//=> eating

Defined in

statistics.d.ts:395

minByConcur(fn)

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

Returns a concur iterable containing a minimum value of concurIterable based on the fn AsyncCompare function if concurIterable contains at least one value. Otherwise, returns an empty concur iterable.

Type Parameters

Value

Parameters

fn: AsyncCompare<Value>

Returns

Function

Parameters

concurIterable: ConcurIterable<Value>

Returns

ConcurIterable<Value>

Example

console.log(
await pipe(
asConcur([`eating`, `sleeping`, `yawning`]),
minByConcur((a, b) => a.length - b.length),
getConcur,
),
)
//=> eating

Defined in

statistics.d.ts:395