mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-10 02:47:50 +00:00
Update _.debounce and _.throttle doc examples and rebuild.
Former-commit-id: fc094e857aeae0ab9581ad56dca894cc96bc7b2e
This commit is contained in:
@@ -4476,6 +4476,11 @@
|
||||
*
|
||||
* var lazyLayout = _.debounce(calculateLayout, 300);
|
||||
* jQuery(window).on('resize', lazyLayout);
|
||||
*
|
||||
* jQuery('.postbox').on('click', _.debounce(sendMail, 200, {
|
||||
* 'leading': true,
|
||||
* 'trailing': false
|
||||
* });
|
||||
*/
|
||||
function debounce(func, wait, options) {
|
||||
var args,
|
||||
@@ -4699,6 +4704,10 @@
|
||||
*
|
||||
* var throttled = _.throttle(updatePosition, 100);
|
||||
* jQuery(window).on('scroll', throttled);
|
||||
*
|
||||
* jQuery('.interactive').on('click', _.throttle(renewToken, 300000, {
|
||||
* 'trailing': false
|
||||
* }));
|
||||
*/
|
||||
function throttle(func, wait, options) {
|
||||
var args,
|
||||
|
||||
Reference in New Issue
Block a user