Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: save the code with ctrl + s #150

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

Alfred-Skyblue
Copy link
Member

If you use the change event to save the code, every input triggers the save, I refactored it to use ctrl+s to save the code, and if there is no input within five seconds, the code is automatically saved.

@vercel
Copy link

vercel bot commented Aug 14, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
repl ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 27, 2023 3:45am

Copy link
Member

@sxzz sxzz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we can have an option for auto saving.

@Alfred-Skyblue
Copy link
Member Author

Maybe we can have an option for auto saving.

When the onChange event triggers frequently, it can be disruptive, especially when I haven't finished coding. To address this issue, I've implemented a debounce and added an autoSave attribute to control the frequency of automatic saving.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants