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

perf(TextEllipsis): reuse windowWidth to avoid repeat calculations #12471

Merged
merged 1 commit into from
Nov 24, 2023

Conversation

inottn
Copy link
Collaborator

@inottn inottn commented Nov 24, 2023

  1. Recalculation is only needed when the window width changes.
  2. By reusing the windowWidth variable, we can avoid registering event listeners multiple times.

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (3410b1c) 89.89% compared to head (5f59a60) 89.87%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #12471      +/-   ##
==========================================
- Coverage   89.89%   89.87%   -0.02%     
==========================================
  Files         257      257              
  Lines        6798     6798              
  Branches     1648     1648              
==========================================
- Hits         6111     6110       -1     
  Misses        366      366              
- Partials      321      322       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@chenjiahan chenjiahan merged commit f0b7af1 into youzan:main Nov 24, 2023
@chenjiahan
Copy link
Member

👍

@inottn inottn deleted the perf/text-ellipsis branch October 14, 2024 06:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants