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

ReactiveUI.Primitives.Disposables.DisposableBag

public sealed class DisposableBag : IsDisposed, IDisposable
A composite disposable that holds its first two entries in inline fields and spills further entries into a heap-allocated array.
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, disposing it immediately if the bag is disposed and ignoring a null argument.

public void Dispose()