Closed rainerllera closed 4 months ago
Hiya
Please submit a PR based off release/5.5 and we can discuss the implementation :)
Fixed in 6.0
@mrpmorris Any news on when will this be released? Looks like changes were made almost a year ago, however, I can see that FluxorComponent
still implements IDisposable
.
I'm going through the motions now. Checking github issues to see what I should include.
Hey @mrpmorris , first of all thank you so much for your work on Fluxor, It is a great tool!
This is more of a feature request I think? So here it goes:
Sometimes Components need to be disposed asynchronously, like when you need to post some value back to the server when exiting the component, unsubscribe from SignalR groups gracefully etc. Right now, the blazor renderer expects components to implement either
IAsyncDisposable
orIDisposable
when disposing them, but favors the asynchronous method (i.e. it only calls eitherDisposeAsync
orDispose
, in that order, not both). See this.Now quite a few of my components inherit from
FluxorComponent
, and I usually dispose things by overridingDispose(bool disposing)
, but since the framework has that limitation/constraint explained above, whenever I need to implementIAsyncDisposable
I need to remember to manually callDispose()
in there, because the Renderer won't do it.Not calling dispose manually there will result in a supposedly dead (disposed) component (for the renderer) but a Fluxor component with active State/Action subscriptions. It's kind of a weird scenario where you would expect your component to be disposed, but it is not.
Anyways, thought maybe providing some similar pattern to the Dispose(disposing) but in an async fashion could be useful to others as well. Again, thanks for your work man. Cheers!
PS: happy to submit a PR if you find it useful.