Ability to use debouncing instead of throttling
Ability to use debouncing instead of throttling
When using server side processing it makes more sense to use debouncing instead of throttling. Just to provide a clear example, if somebody searches, for instance, 'beautiful' I don't want my server to process a request each time for 'b','bea', 'beaut' and 'beautiful'. I could set a high searchDelay
, let's say 1000, but it will still process 'b' and 'beautiful' at best, and at worst the user will have to wait 1000 milliseconds between requests, instead of a more reasonable 350ms or something that could be appropriate when using debouncing.
I'm basically asking for the addition of 2 new settable options:
'delayMode': 'throttle|debounce',
'serverSideDelayMode': 'throttle|debounce'
The names don't really matter. Basically delayMode
should allow people to choose between throttling and debouncing, serverSideDelayMode
will allow to automatically use debouncing when using server side processing.
Do you have any reason not to include this? If you agree with me I might even work on a pull request in the following days.
Replies
I've created an issue on GitHub for this.