Hello Rx

The problem with creating your first Rx program is that if it is simple enough to qualify for the job, then it is too simple to do anything more useful than what could be done without it. The following is an example:

var input = Observable.Range(1,15); input.Subscribe(x => Console.WriteLine("The number is {0}", x));

As you'll learn in Chapter 3, the Range operator takes two parameters: a starting value and the number of values to generate. In this case, it will generate the numbers 1 through 15. The return of Observable.Range is of type IObservable of the inferred type int. If you hover over the input in the first line —in LINQPad or Visual Studio, but not, unfortunately, in this book—you will see that it is of the following type: ...

Get Programming Reactive Extensions and LINQ now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.