RunicConnectionsExtensions class

Namespace Runic.Application.Views in Runic.Application.Views 0.23.0

public static class RunicConnectionsExtensions

Observable forms of IRunicConnections, for ReactiveUI and other IObservable consumers.

Methods

WhenChanged

public static IObservable<IReadOnlyList<RunicConnection>> WhenChanged(this IRunicConnections connections)

Emits IRunicConnections.Current when subscribed and again after each connection that connects or disconnects, on the thread that raised the event: a turn of the Window's model context.

Parameters

connections

The Window's connections.

Returns

The connections after each change.

Remarks

It needs no System.Reactive, and works with both ReactiveUI flavors:

_viewers = connections.WhenChanged().Select(list => list.Count).ToProperty(this, vm => vm.Viewers);

Dispose the subscription to stop it.