-
Notifications
You must be signed in to change notification settings - Fork 93
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
fix(click-outside): remove memory leak #319
Conversation
☁️ Nx Cloud ReportCI is running/has finished running commands for commit 00b681c. As they complete they will appear below. Click to see the status, the terminal output, and the build insights. 📂 See all runs for this CI Pipeline Execution ✅ Successfully ran 4 targetsSent with 💌 from NxCloud. |
@Directive({ | ||
selector: '[clickOutside]', | ||
standalone: true, | ||
providers: [provideDocumentClick()], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will create a listener for each directive, while the previous method, would create only one listener for the whole document, and each directive will use the same listener, which makes it more performant I think.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought about performance and i figured it out - Using multiple outsideClicks on one view will be rare.
When using outsideClick (which is standalone) we are not aware that it has global awareness.
No description provided.