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

x/rimbu/core/mod.ts>Transformer.splitOn

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

Returns a Transformer that collects the received elements into a collector that will be returned as output every time the input matches the given sepElem value.

Parameters

sepElem: T
  • a predicate function taking an element
optional
options: { eq?: Eq<T> | undefined; negate?: boolean | undefined; collector?: Reducer<T, R> | undefined; } = [UNSUPPORTED]
  • (optional) object specifying the following properties
  • eq - (default: Eq.objectIs) the equality testing function
  • negate: (default: false) when true will negate the given predicate
  • collector: (default: Reducer.toArray()) an AsyncReducer that can accept multiple values and reduce them into a single value of type R.