<PackageReference Include="ReactiveUI.Disposables" Version="7.3.0" />

ReactiveUI.Primitives.Disposables.DisposableBag

public sealed class DisposableBag : IsDisposed, IDisposable
A small composite-disposable replacement specialised for the common 2-slot "subscription + sink" pair found throughout this codebase. Avoids the List<T> backing field of System.Reactive.Disposables.CompositeDisposable.
public bool IsDisposed { get; }

Gets a value indicating whether this instance has been disposed.

public DisposableBag()

Initializes a new instance of the DisposableBag class.

public DisposableBag(IDisposable first, IDisposable second)

Initializes a new instance of the DisposableBag class with two pre-populated slots.

public DisposableBag(IDisposable first, IDisposable second, IDisposable third)

Initializes a new instance of the DisposableBag class with three pre-populated slots.

public void Add(IDisposable disposable)

Adds a disposable to the bag. If the bag is already disposed, the supplied disposable is disposed immediately.

public void Dispose()