-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating
Reactive Programming for .NET Developers
By :
Filtering operators act as the where operators of any LINQ query. They reduce, take, or peek a value (or multiple values) from a sequence when messages comply with a given filtering function.
The easiest filtering operator, filter, simply applies a filtering condition that allows or prevents messages from flowing throughout the newly created sequence. In Rx, the filter operator in made by using the Where extension method like in any other LINQ query.

A marble diagram showing a filter operation
Here's an example:
var s12 = new Subject<string>();
var filtered = s12.Where(x => x.Contains("e"));
filtered.Subscribe(Console.WriteLine);
s12.OnNext("Mr. Brown");
s12.OnNext("Mr. White");
The distinct operator, similar to what happens in any SQL statement, creates a new sequence that prevents duplicated values from flowing out from the source sequence.

A marble diagram showing a distinct operation
Here's an example:
var s13 = new...