import { AsyncTransformer } from "https://deno.land/x/rimbu@1.2.1/stream/async/async-transformer.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
.