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

x/rimbu/core/mod.ts>AsyncTransformer.splitOnSlice

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

Returns an AsyncTransformer that collects the received elements into a collector that will be returned as output every time the input matches the given sepSlice sequence of elements.

Parameters

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