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

add debouncer to editor onChange event #138

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

Conversation

autr
Copy link

@autr autr commented Jan 9, 2024

400ms debouncer so sketch doesn't begin updating until you have finished typing

store.code.update(e, true);
if (debounceReference) clearTimeout(debounceReference);
debounceReference = setTimeout( () => {
store.code.update(e, true);
Copy link
Owner

Choose a reason for hiding this comment

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

You probably should clear the reference here as well? The best way might be to just use the debounce depedency that is part of the package anyway.

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.

2 participants