Blazor, auto unsubscribe pattern
I have created website using blazor, and if some component subscribe to something then it implement IDisposable interface to cleanup subscriptions. Because i have also a little experience with angular, rx.js and simillar, i wonder if it is good idea to introduce simillar pattern to backend:
and base class will automatically cleanup all subscrptions, what do you think? do you have any other examples like this?
I ask because i'm warry that in more complex scenario where for example events are subscribed conditionally i may leave some not cleanuped event handlers
0 Replies