Skip to content

A light weight .NET Standard library that provides a DisposeWith extension method to IDisposable objects. This is an alternative to the method provided by ReativeUI, allowing for a much smaller library dependency.

License

Notifications You must be signed in to change notification settings

kyleherzog/RxDisposableExtensions

Repository files navigation

Build Status

This library is available from NuGet.org.


A light weight .NET Standard library that provides a DisposeWith extension method to IDisposable objects. This is an alternative to the method provided by ReativeUI, allowing for a much smaller library dependency.

See the changelog for changes and roadmap.

Features

DisposeWith

An extension method for IDisposable objects that will add the object to the given CompositeDisposable specified.

public class MyClass
{
    private readonly CompositeDisposable cd = new CompositeDisposable();

    public MyClass() 
    {
        Observable.FromEventPattern<PropertyChangedEventHandler, PropertyChangedEventArgs>(
                x => response.PropertyChanged += x,
                x => response.PropertyChanged -= x)
                .Where(x => x.EventArgs.PropertyName == nameof(MyProperty))
                .Subscribe(_ => DoSomething())
                .DisposeWith(cd);
    }
}

License

MIT

About

A light weight .NET Standard library that provides a DisposeWith extension method to IDisposable objects. This is an alternative to the method provided by ReativeUI, allowing for a much smaller library dependency.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages