Skip to main content
Module

x/rimbu/mod.ts>Reducer.some

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

Returns a Reducer that ouputs false as long as no input value satisfies given pred, true otherwise.

Examples

Example 1

console.log(Stream.range{ amount: 10 }).reduce(Reducer.some(v => v > 5))
// => true

Parameters

pred: (value: T, index: number) => boolean
  • a function taking an input value and its index, and returning true if the value satisfies the predicate

Returns

Reducer<T, boolean>