import { Transformer } from "https://deno.land/x/rimbu@1.0.2/stream/mod.ts";
const { distinctPrevious } = Transformer;
Returns a transformer that returns only those elements from the input that are different to previous element
according to the optionally given eq
function.
Examples
Example 1
Example 1
Stream.of(1, 1, 2, 3, 2, 2)
.transform(Transformer.distinctPrevious())
.toArray()
// => [1, 2, 3, 2]
Parameters
optional
eq: Eq<T> = [UNSUPPORTED]- (default:
Eq.objectIs
) the equality testing function