Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use WeakSet to replace fitties arrray #101

Open
chigia001 opened this issue Dec 7, 2023 · 1 comment
Open

Use WeakSet to replace fitties arrray #101

chigia001 opened this issue Dec 7, 2023 · 1 comment

Comments

@chigia001
Copy link

chigia001 commented Dec 7, 2023

Right now in the code, we are using a plain array to store HTMLElement.

This can cause run-time unable to gabage collector those HTMLElement after the HTMLElement already remove in DOM.

Right now we need to call the unsubscribe on on the fitty instance to instead. But using Weakset, we can let the run-time GC those element for us.

@rikschennink
Copy link
Owner

Thanks for the suggestion, that indeed sounds like a nice improvement.

Note that there are probably lots of improvements possible, but at this point if it works I'm mostly okay with not changing it.

Lemon2311 added a commit to Lemon2311/fitty that referenced this issue Dec 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants