JoeyMckenzie / JoeyMckenzie/BlazorConduit
Missing unsubscribe
- Dominant language
- C#
- Stars
- 80
- Forks
- 21
- PR merge metrics
- No merged PRs in 30d
Description
https://github.com/JoeyMckenzie/BlazorConduit/blob/master/source/BlazorConduit.Client/Pages/Article/Article.razor#L79
This is a standard .NET event. If you don't remove your subscription then the store will keep a reference to your component instance and it will never be garbage collected, resulting in a memory leak.
Personally I wouldn't subscribe to the event. It's really only meant for people who can't descend from `FluxorComponent` (which you have).
I would change IsFollowing to a property:
```
private bool IsFollowing =>
state.IsFollowingUser
?? state.CurrentArticle?.Author?.Following
?? false;
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.