react-component / overflow

📦 Auto collapse box util component
overflow-git-master.react-component.vercel.app
MIT License
51 stars 36 forks source link

refactor: Use channel to optimize render #32

Closed zombieJ closed 1 year ago

zombieJ commented 1 year ago

使用 MessageChannel 使其批量更新在下一帧前,Resize 事件后。从而避免渲染时额外的跳动。需要多看看是否对使用有影响。

ref https://github.com/ant-design/ant-design/issues/41374

vercel[bot] commented 1 year ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated
overflow ❌ Failed (Inspect) Mar 22, 2023 at 2:16AM (UTC)
codecov[bot] commented 1 year ago

Codecov Report

Merging #32 (af63786) into master (478db39) will decrease coverage by 1.44%. The diff coverage is 90.32%.

:exclamation: Current head af63786 differs from pull request most recent head 559dbbb. Consider uploading reports for the commit 559dbbb to get more accurate results

@@            Coverage Diff             @@
##           master      #32      +/-   ##
==========================================
- Coverage   99.50%   98.07%   -1.44%     
==========================================
  Files           4        5       +1     
  Lines         203      208       +5     
  Branches       69       68       -1     
==========================================
+ Hits          202      204       +2     
- Misses          1        4       +3     
Impacted Files Coverage Δ
src/hooks/channelUpdate.ts 50.00% <50.00%> (ø)
src/Overflow.tsx 99.30% <100.00%> (ø)
src/hooks/useEffectState.tsx 100.00% <100.00%> (ø)

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more