404kacper / 404kacper/RAN-logger

LogsState - context api - preferences

未關閉
#17 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
主要語言
TypeScript
星號
0
分支
0
PR 合併指標
30 天內沒有已合併 PR

描述

With current implementation, whenever preferences are checked true to false they will remove all of logs data from storage (caused by re-render of LogsState due to preferences state dispatch/update) - to solve that different Context provider say PreferencesState is needed that will be wrapped by LogsState so that it's updates aren't impacting renders of LogsState that is an expensive operation when files will reach sizes of +20MB.

Way in which logs are added to local storage is as follows:
file dropped --> promises resolve causing state to update -> each update to logs causes useEffect in files to overwrite values in local storage with current state.logs (except for initial render since it's only fetching)

貢獻指南

這個儲存庫沒有索引到貢獻指南

研究方向

檢查 codebase 中的 LogsState 和 PreferencesState context providers。理解 logs 資料如何儲存在 localStorage 中,以及寫入它的 useEffect。此修復涉及重構 React context tree,使 LogsState 不會因 preferences 更新而重新渲染。查找新增 logs 的檔案與儲存機制,以防在 preference 切換時發生資料流失。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
react
領域
frontend, performance
Issue 類型
缺陷
難度
4/5
預估耗時
3-5 天
活躍度
停滯
描述清晰度
基本清楚
新手友好度
30/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。