Adding more examples for the flushSync method
還沒有人認領這個 Issue。
- 主要語言
- JavaScript
- 星號
- 11.8k
- 分支
- 7.9k
- 平均合併
- 1 天 11 小時
- 30 天內合併 PR
- 11
描述
Hey there, I'm the author of the following post https://giacomocerquone.com/keep-input-cursor-still/ where I showcased a few pain points while managing an input's cursor.
Earlier today I also noticed this tweet from Ryan Florence where he was showcasing the usage of the flushSync method in a similar way to the one I was going after using low-level asynchronicity js tools to tame the eventloop such as setTimeout, await Promise.resolve(), etc. etc.
Do you think we could add such examples in the docs or it's just an internal method not to be used so commonly?
Svelte has also something similar in its documentation/tutorial with the tick method https://learn.svelte.dev/tutorial/tick
貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
研究方向
先找出現有的 flushSync 文件與範例,接著檢視連結的游標管理文章和 Ryan Florence 的範例,以了解相關使用情境。完成的標準是新增清楚的文件範例,或記錄為什麼不應普遍使用 flushSync,並確保相關指引與 React 預期的使用方式一致。
由索引模型根據 Issue 內容生成。
評估
- 技術堆疊
- javascript, react
- 領域
- documentation
- Issue 類型
- 文件
- 難度
- 3/5
- 預估耗時
- 1-2 天
- 活躍度
- 停滯
- 描述清晰度
- 需要釐清
- 新手友好度
- 35/100