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

Since

v0.0.1

Call Signature

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

Type Parameters

Value

Parameters

fn

AsyncCompare<Value>

concurIterable

ConcurIterable<Value>

Returns

ConcurOptional<Value>

Defined in

statistics.d.ts:416

Call Signature

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

Type Parameters

Value

Parameters

fn

AsyncCompare<Value>

Returns

Function

Parameters

concurIterable

ConcurIterable<Value>

Returns

ConcurOptional<Value>

Defined in

statistics.d.ts:416