import { AsyncTransformer } from "https://deno.land/x/rimbu@0.13.5/core/main/exports.ts";
const { distinctPrevious } = AsyncTransformer;
Returns an async 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
await AsyncStream.of(1, 1, 2, 3, 2, 2)
.transform(AsyncTransformer.distinctPrevious())
.toArray()
// => [1, 2, 3, 2]