Adding more examples for the flushSync method
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 11.8k
- Forks
- 7.9k
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 11
Description
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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the existing flushSync documentation and examples, then review the linked cursor-management article and Ryan Florence’s example for relevant use cases. Done means adding clear documentation examples, or documenting why flushSync should not be commonly used, with the guidance consistent with React’s intended usage.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, react
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100