Due to the frequent updates of the Console and Network panels, and the increasing number of states with the duration of debugging, it becomes necessary to optimize. To address this issue, I have utilized useRef() to store states that require optimization and updated them through useXXXStore.subscribe(). Additionally, I have introduced useThrottleForceRender to ensure that the states are correctly rendered on the page.
对于复杂应用,
Console
和Network
面板的状态更新的频率通常非常高,而且状态数量伴随着调试时长会越来越多。针对这个问题,这个变更里将有必要优化的状态都通过useRef()
保存、并通过useXXXStore.subscribe()
更新,同时新增了useForceThrottleRender
保证状态能正确渲染到页面上。Due to the frequent updates of the
Console
andNetwork
panels, and the increasing number of states with the duration of debugging, it becomes necessary to optimize. To address this issue, I have utilizeduseRef()
to store states that require optimization and updated them throughuseXXXStore.subscribe()
. Additionally, I have introduceduseThrottleForceRender
to ensure that the states are correctly rendered on the page.