Skip to main content

Function: minMaxWithConcur()

Returns a concur iterable containing a MinMax value of concurIterable by comparing the numerical values of each value, as defined by fn, if concurIterable contains at least one value. Otherwise, returns an empty concur iterable.

Example

console.log(
await pipe(
asConcur([`eating`, `sleeping`, `yawning`]),
minMaxWithConcur(value => value.length),
getConcur,
),
)
//=> { min: 'eating', max: 'sleeping' }

Since

v0.0.2

Call Signature

minMaxWithConcur<Value>(fn, concurIterable): ConcurOptional<MinMax<Value>>

Type Parameters

Value

Parameters

fn

(value) => MaybePromiseLike<number>

concurIterable

ConcurIterable<Value>

Returns

ConcurOptional<MinMax<Value>>

Defined in

statistics.d.ts:1036

Call Signature

minMaxWithConcur<Value>(fn): (concurIterable) => ConcurOptional<MinMax<Value>>

Type Parameters

Value

Parameters

fn

(value) => MaybePromiseLike<number>

Returns

Function

Parameters

concurIterable

ConcurIterable<Value>

Returns

ConcurOptional<MinMax<Value>>

Defined in

statistics.d.ts:1040