Async Disposables The Easy Way

added by DotNetKicks
12/13/2021 6:02:57 PM

352 Views

In the System.Reactive.Disposables namespace (part of Reactive Extensions), there's a small and useful Disposable class. It has a Create method that takes in an Action and returns an IDisposable instance. When that instance is disposed, the action is called. It's a nice way of creating an ad-hoc IDisposable.


0 comments