Skip to main content

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.

Definition

function distinctPrevious<T>(eq?: Eq<T>): Transformer<T>;

Type parameters
NameDescription
T

Parameters

NameTypeDescription
eqEq<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

NameDescription
windowReturns 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.