
jquery-debounce
Debounce and throttle function's decorator plugin
Simple debounce and throttle implementations
Using
``` debouncedFn = $.debounce(fn, timeout, [invokeAsap], [ctx]);
throttledFn = $.throttle(fn, timeout, [ctx]); ```
Example of debouncing
$('input[name=suggest]').keyup($.debounce(onKeyUp, 300));
or
$('input').bind('keyup blur', $.debounce(process, 300));
Example of throttling
$(window).resize($.throttle(doComplexСomputation, 300));
Author
See also
Project Information
- License: MIT License
- 26 stars
- svn-based source control