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

Should use window.matchMedia #1

Closed
ekwoka opened this issue May 17, 2023 · 1 comment
Closed

Should use window.matchMedia #1

ekwoka opened this issue May 17, 2023 · 1 comment
Labels
optimization Code optimization

Comments

@ekwoka
Copy link

ekwoka commented May 17, 2023

Instead of a window resize listener, using windows.matchMedia you can generate an even object that uses the css engine to indicate where a media query has changed from true to false or vice versa, not needing to run a callback for every portal on every pixel resize change.

nabeghe added a commit that referenced this issue May 17, 2023
@nabeghe
Copy link
Owner

nabeghe commented May 17, 2023

Thank you Eric, for your attention.
The portal was implemented using matchMedia.

@nabeghe nabeghe closed this as completed May 17, 2023
@nabeghe nabeghe added the optimization Code optimization label May 17, 2023
nabeghe added a commit that referenced this issue May 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
optimization Code optimization
Projects
None yet
Development

No branches or pull requests

2 participants