Skip to content

Rx.NET v5.0.0

Compare
Choose a tag to compare
@clairernovotny clairernovotny released this 10 Nov 16:28

Rx 5.0

The Rx 5.0 release shipped on November 10, 2020 as part of the .NET 5.0 release wave.

Changes:

The query operators in Rx now support the C# 8.0 nullable reference types feature. For example, the DefaultIfEmpty operator now has the following signature:

public static IObservable<TSource?> DefaultIfEmpty<TSource>(this IObservable<TSource> source)

Various types in System.Reactive now support deconstruction, for example:

var ts = new Timestamped<string>("bar", DateTimeOffset.UtcNow);
var (value, time) = ts;

Combining operators such as CombineLatest and Zip now support ValueTuple<>-based overloads (up to 8 components). For example:

public static IObservable<(TFirst First, TSecond Second)> Zip<TFirst, TSecond>(this IObservable<TFirst> first, IObservable<TSecond> second)

Exceptions rethrown inside Rx now are guaranteed to preserve the original stack trace by using ExceptionDispatchInfo consistently across the board. We also have changed the way fresh exceptions on OnError are created, e.g. InvalidOperationException for an empty sequence passed to SingleAsync, in order to guarantee there's a useful stack trace.

The implementation of Rx has also moved to use C# 9.0 features internally, for example static lambdas.