import { Reducer } from "https://deno.land/x/rimbu@1.0.0/common/internal.ts";
const { maxBy } = Reducer;
Returns a Reducer
that remembers the maximum value of the inputs using the given compFun
to compare input values
Examples
Example 1
Example 1
const stream = Stream.of('abc', 'a', 'abcde', 'ab')
console.log(stream.maxBy((s1, s2) => s1.length - s2.length))
// 'abcde'