namespace Transformer_2
A Reducer that produces instances of StreamSource
.
Companion type: Transformer_2<T,R>
Functions
distinctPrevious
Returns a transformer that returns only those elements from the input that are different to previous element according to the optionally given eq
function.
distinctPrevious
eq
function.Definition
function distinctPrevious<T>(eq?: Eq<T>):
Transformer
<T>;
Type parameters
Name | Description |
---|---|
T |
Parameters
Name | Type | Description |
---|---|---|
eq | Eq<T> | (default: Eq.objectIs ) the equality testing function |
example
Stream.of(1, 1, 2, 3, 2, 2)
.transform(Transformer.distinctPrevious())
.toArray()
// => [1, 2, 3, 2]
Constants
Name | Description |
---|---|
window | Returns a transformer that produces windows/collections of windowSize size, each window starting skipAmount of elements after the previous, and optionally collected by a custom reducer. |