hooks icon indicating copy to clipboard operation
hooks copied to clipboard

perf(useMap): reduce re-render

Open coding-ice opened this issue 1 year ago • 5 comments

[中文版模板 / Chinese template]

🤔 This is a ...

  • [ ] New feature
  • [ ] Bug fix
  • [ ] Site / documentation update
  • [ ] Demo update
  • [ ] TypeScript definition update
  • [ ] Bundle size optimization
  • [x] Performance optimization
  • [ ] Enhancement feature
  • [ ] Internationalization
  • [ ] Refactoring
  • [ ] Code style optimization
  • [ ] Test Case
  • [ ] Branch merge
  • [ ] Other (about what?)

🔗 Related issue link

💡 Background and solution

📝 Changelog

Language Changelog
🇺🇸 English
🇨🇳 Chinese

☑️ Self Check before Merge

⚠️ Please check all items below before review. ⚠️

  • [x] Doc is updated/provided or not needed
  • [x] Demo is updated/provided or not needed
  • [x] TypeScript definition is updated/provided or not needed
  • [x] Changelog is provided or not needed

coding-ice avatar Dec 02 '23 12:12 coding-ice

另外向reset这种,大部分都没有考虑随机数的情况,统一处理下不?如果要的话我整理一起弄下

coding-ice avatar Apr 25 '24 13:04 coding-ice

另外向reset这种,大部分都没有考虑随机数的情况,统一处理下不?如果要的话我整理一起弄下

意思是现在 initialValue 传随机值的话,reset 会有问题是吗?

liuyib avatar Apr 25 '24 13:04 liuyib

另外向reset这种,大部分都没有考虑随机数的情况,统一处理下不?如果要的话我整理一起弄下

意思是现在 initialValue 传随机值的话,reset 会有问题是吗?

是的,useSet/useMap等 初始值都存在随机数问题

coding-ice avatar Apr 25 '24 13:04 coding-ice

useSet/useMap 都存随机数问题 reset,没有单独处理过的 应该都存在

可以测试下。如果确实有问题,辛苦开个新的 PR 处理下哈~

另外,看下这个 PR 是否需要补单测,应该是需要的。多谢

liuyib avatar Apr 25 '24 13:04 liuyib

useSet/useMap 都存随机数问题 reset,没有单独处理过的 应该都存在

可以测试下。如果确实有问题,辛苦开个新的 PR 处理下哈~

另外,看下这个 PR 是否需要补单测,应该是需要的。多谢

Done!

coding-ice avatar Apr 26 '24 11:04 coding-ice

这个性能完全不用考虑,不会成为性能问题,多加的这些代码反而影响阅读,这个pr 就不合了

crazylxr avatar Jul 11 '24 01:07 crazylxr