Skip to main content

Function: maxByConcur()

Returns a concur iterable containing a maximum 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`]),
maxByConcur((a, b) => a.length - b.length),
getConcur,
),
)
//=> sleeping

Since

v0.0.1

Call Signature

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

Type Parameters

Value

Parameters

fn

AsyncCompare<Value>

concurIterable

ConcurIterable<Value>

Returns

ConcurOptional<Value>

Defined in

statistics.d.ts:518

Call Signature

maxByConcur<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:518