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

x/rimbu/core/main/index.ts>Reducer.min

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

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

Examples

Example 1

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

type

{ (): Reducer<number, number | undefined>; <O>(otherwise: OptLazy<O>): Reducer<number, number | O>; }