Skip to main content
Module

x/rimbu/mod.ts>AsyncReducer.single

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

Returns an AsyncReducer that only produces an output value when having receives exactly one input value, otherwise will return the otherwise value or undefined.

type

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

type

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