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