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

Purpose of debounce #99

Closed
lonix1 opened this issue Mar 10, 2024 · 1 comment
Closed

Purpose of debounce #99

lonix1 opened this issue Mar 10, 2024 · 1 comment

Comments

@lonix1
Copy link
Contributor

lonix1 commented Mar 10, 2024

I find the debounce default of 300ms to be quite slow, especially when changing from validating on input to on blur.

I changed it to 0 which serves my needs, but I'm unsure why that debounce is there, and whether I'm asking for trouble by changing it.

Why is there a debounce? Am I right in assuming it's specifically for the "validate on input" scenario?

(If so, I'll write up a little section for the docs...)

@haacked
Copy link
Owner

haacked commented Mar 18, 2024

I changed it to 0 which serves my needs, but I'm unsure why that debounce is there, and whether I'm asking for trouble by changing it.

The primary reason for debounce is so we don't do unnecessary validation. Especially in the case of remote validation. For example, suppose someone starts typing in an input. We don't necessarily want to validate every character typed. We want to wait till there's a pause and then validate.

If 300 is too slow, I'd change it to 100 and see how that feels.

@haacked haacked closed this as completed Mar 18, 2024
@lonix1 lonix1 mentioned this issue Mar 19, 2024
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

No branches or pull requests

2 participants