Files
PLib/src/PLib.Desktop/ViewModels/DisposableExtensions.cs
T

15 lines
577 B
C#

using System.Reactive.Disposables;
namespace PLib.Desktop.ViewModels;
internal static class DisposableExtensions
{
/// <summary>
/// Parks a subscription in the owner's bag so it dies with the owner. Spelled out here
/// rather than pulled from an Rx extension namespace, because more than one library in
/// this project ships a <c>DisposeWith</c> and importing either invites ambiguity.
/// </summary>
public static void AddTo(this IDisposable disposable, CompositeDisposable subscriptions) =>
subscriptions.Add(disposable);
}