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

x/rimbu/core/mod.ts>Reducer.count

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

A Reducer that remembers the amount of input items provided.

Examples

Example 1

const stream = Stream.range({ amount: 10 })
console.log(stream.reduce(Reducer.count))
// => 10

type

Reducer<any, number>