Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/rimbu/core/main/exports.ts>AsyncReducer.max

Rimbu is a TypeScript library focused on immutable, performant, and type-safe collections and other tools.
Go to Latest
variable AsyncReducer.max
import { AsyncReducer } from "https://deno.land/x/rimbu@1.0.3/core/main/exports.ts";
const { max } = AsyncReducer;

Returns a Reducer that remembers the maximum value of the numberic inputs.

Examples

Example 1

console.log(Stream.of(5, 3, 7, 4).reduce(Reducer.max()))
// => 7

type

{ (): AsyncReducer<number, number | undefined>; <O>(otherwise: AsyncOptLazy<O>): AsyncReducer<number, number | O>; }