import { AsyncTransformer } from "https://deno.land/x/rimbu@1.2.1/stream/async/async-transformer.ts";
const { splitOn } = 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 sepElem
value.
Parameters
sepElem: T
- a potentially async predicate function taking an element
optional
options: { eq?: Eq<T> | undefined; negate?: boolean | undefined; collector?: AsyncReducer.Accept<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
.