JoeyMckenzie / JoeyMckenzie/BlazorConduit

Missing unsubscribe

Open
#5 1 comment 2 reactions 0 assignees View on GitHub
good first issue
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.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.