Table of Contents

Class Distinct

Namespace
Bonsai.Reactive
Assembly
Bonsai.Core.dll

Represents an operator that returns an observable sequence containing only distinct elements.

Marble diagram

The Distinct operator ensures that only unique elements are included in the result sequence. Uniqueness is specified by the default EqualityComparer<T> for the type of the elements in the source sequence. If multiple non-unique elements are present in the source sequence, only the first element will be included in the result sequence.

Example

Use Distinct to extract unique elements from a sequence.

Distinct Example

Alternative

Use DistinctUntilChanged to extract elements that are distinct from the previous element.

public class Distinct : Combinator
Inheritance
Distinct
Inherited Members

Methods

Process<TSource>(IObservable<TSource>)

Returns an observable sequence containing only distinct elements.