Support for debouncing validations
Is your feature request related to a problem? Please describe.
I use a resolver that requires to do some requests to some endpoint (using the requests as an example), with the onChange mode. The problem is that everytime the user tries to enter any values to some inputs, the inputs trigger the validation lots of times, leading to an execution of lots of unwanted requests to this enpdoint.
Describe the solution you'd like My solution would be to debounce these validations and also setting an optional custom delay in miliseconds to control the frequency of times the form has to validate.
Describe alternatives you've considered
I'm currently using the useDebounceCallback from usehooks-ts to define the validation and the request fetches "manually" in my components.
Have you tried debouncing the update to the state in the first place? meaning delay updating the hook form state so that when user stopped typing then the validation will be triggered.
Have you tried debouncing the update to the state in the first place? meaning delay updating the hook form state so that when user stopped typing then the validation will be triggered.
An example for implementing this would be to create a field component using useController to control the input and then debouncing the field.onChange report itself right?
@zjsng Yes, that or setValue("fieldName", asyncValue)