Fixed documentation for debounce

This commit is contained in:
Ben Zörb
2014-12-28 22:42:28 +01:00
parent 3f8dd7e658
commit 34bc182c22

View File

@@ -6947,13 +6947,13 @@
* jQuery('#postbox').on('click', _.debounce(sendMail, 300, { * jQuery('#postbox').on('click', _.debounce(sendMail, 300, {
* 'leading': true, * 'leading': true,
* 'trailing': false * 'trailing': false
* }); * }));
* *
* // ensure `batchLog` is invoked once after 1 second of debounced calls * // ensure `batchLog` is invoked once after 1 second of debounced calls
* var source = new EventSource('/stream'); * var source = new EventSource('/stream');
* jQuery(source).on('message', _.debounce(batchLog, 250, { * jQuery(source).on('message', _.debounce(batchLog, 250, {
* 'maxWait': 1000 * 'maxWait': 1000
* }, false); * }));
* *
* // cancel a debounced call * // cancel a debounced call
* var todoChanges = _.debounce(batchLog, 1000); * var todoChanges = _.debounce(batchLog, 1000);