<PackageReference Include="ReactiveUI.Primitives.Core" Version="8.2.0" />

ReactiveUI.Primitives.Advanced.SharedSubscription

public sealed class SharedSubscription : IDisposable
Keeps one underlying subscription alive until its own handle and every lease taken from it have been disposed.
public bool IsDisposed { get; }

Gets a value indicating whether the primary handle has been disposed.

Takes a lease that keeps the underlying subscription alive until it is disposed.

public void Attach(IDisposable underlying)

Assigns the underlying subscription, disposing it at once when it has already been released or one is attached.

public void Dispose()

Disposes the primary handle; the underlying subscription is released now when no lease is held.

public void Release()

Releases the underlying subscription now, whatever leases remain.