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' }

minMaxWithConcur(fn, concurIterable)

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

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.

Type Parameters

Value

Parameters

fn

concurIterable: ConcurIterable<Value>

Returns

ConcurIterable<MinMax<Value>>

Example

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

Defined in

statistics.d.ts:990

minMaxWithConcur(fn)

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

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.

Type Parameters

Value

Parameters

fn

Returns

Function

Parameters

concurIterable: ConcurIterable<Value>

Returns

ConcurIterable<MinMax<Value>>

Example

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

Defined in

statistics.d.ts:994