Function: toMinMax()
toMinMax():
OptionalReducer
<MinMax
<number
>>
Returns an optional reducer that finds the MinMax value of the values it receives.
Use when composing reducers. Prefer minMax for direct use on iterables.
Returns
OptionalReducer
<MinMax
<number
>>
Example
console.log(
pipe(
[`sloth`, `more sloth`, `sleep`, `some sloth`],
map(string => [string.length, string.codePointAt(0)]),
reduce(toGrouped(toMinMax(), toMap())),
),
)
//=> Map(2) { 5 => { min: 115, max: 115 }, 10 => { min: 109, max: 115 } }