Skip to content

DisposableExtensions.DisposeWith(T, CompositeDisposable) method

Defined in

Type: DisposableExtensions Namespace: System.Reactive.Disposables.Fluent Assembly: System.Reactive.dll

Applies to

netstandard2.0

public static T DisposeWith<T>(this T item, CompositeDisposable compositeDisposable) where T : IDisposable

Summary: Ensures the provided disposable is disposed with the specified CompositeDisposable.

Type parameters

NameDescription
TThe type of the disposable.

Parameters

NameTypeDescription
itemTThe disposable we are going to want to be disposed by the CompositeDisposable.
compositeDisposable[CompositeDisposable](#The [CompositeDisposable](# to which item will be added.

Returns: T -- The disposable.