Weak Events?
mysteryx93 opened this issue · 4 comments
Does Reactive.Pharmacist provide a simple solution for weak event handlers?
Got a example of where you'd like to use it?
Found this interesting solution
http://blog.functionalfun.net/2012/03/weak-events-in-net-easy-way.html
If I need weak events in my code, I can use WeakEventHandlerManager, but that class is specific to Avalonia or WPF, and ties down the code to that platform. What if I need a weak event handler in a service that is shared between an Avalonia and a Web project? Or what if I use Avalonia for Desktop apps and Xamarin for mobile apps, using the same back-end?
I’ve written before about one kind of memory leak the .Net Garbage Collector cannot protect against: those caused by event handlers keeping...
I'm not inclined to implement this.
The reason being weak event is usually a anti pattern to Reactive code which has a lot of built in mechanisms for cleaning up after themselves properly such as DisposeWith, CompositeDisposable etc. A IObservable comes with a IDisposable on the Subscribe method.
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.