Solve for Rx: Activity indicator with minimum display time

Solve for Rx I'm going to start a recurring series here on my blog called Solve for Rx in which I solve different problems using Rx. I think this will not only help me push my skills, but I also believe that others will find it helpful to see some…

A practical intro to Rx

If you're trying to get started with programming with reactive extensions and observable programming, you are going to feel overwhelmed. You're trying to start thinking in a new way, and in some cases in a completely opposite way, than what you have been doing since you started programming. In this…

FlatMap explained

I was recently helping an acquaintance out with understanding flatMap (or SelectMany as it's known in Rx.NET). After helping him set up his observables he noted that flatMap is almost like magic. I remember when I was first learning Reactive Extensions that flatMap was one of the operators that…

Task.ToObservable() != Observable.FromAsync(() => Task)

When converting tasks to observables, writing something like this is very common: Observable.FromAsync(() => ThisReturnsATask()); At some point you may discover that there’s actually an extension method for tasks which turns it in to an observable: ThisReturnsATask().ToObservable(); But that is not the same as the first conversion.…

Don’t do extra work, use Publish()

When using Reactive Extensions you sooner or later encounter a point where you end up re-using the same source observable to build two different observables. Something like this perhaps: var somethingsFromWeb = Observable.FromEventPattern(window, nameof(Window.Activated)) .SelectMany(_ => LoadSomethingFromTheWeb()); somethingsFromWeb .Where(x => x.Length > 10) .Subscribe(x…