From 6caad89bac6ab6c3dc9ef98e6f36792776d95e08 Mon Sep 17 00:00:00 2001 From: Ben Carp Date: Tue, 23 Jun 2020 09:45:03 +0300 Subject: [PATCH 1/4] Updating debounce documentation --- underscore.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/underscore.js b/underscore.js index 2cbc6e113..f12683bbd 100644 --- a/underscore.js +++ b/underscore.js @@ -891,10 +891,12 @@ return throttled; } - // Returns a function, that, as long as it continues to be invoked, will not - // be triggered. The function will be called after it stops being called for - // N milliseconds. If `immediate` is passed, trigger the function on the - // leading edge, instead of the trailing. + + + // When a sequence of calls of the returned function ends, the argument + // function is triggered. The end of a sequence is defined by the ‘wait’ + // parameter. If ‘immediate’ is passed the argument function would be + // triggered at the beginning of the sequence as well. function debounce(func, wait, immediate) { var timeout, result; From 78fa7f6bc0a5265d61eb36ded7cecabe49ca5fd2 Mon Sep 17 00:00:00 2001 From: Ben Carp Date: Tue, 23 Jun 2020 10:03:09 +0300 Subject: [PATCH 2/4] formatting --- underscore.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/underscore.js b/underscore.js index f12683bbd..4ce1b0b67 100644 --- a/underscore.js +++ b/underscore.js @@ -890,8 +890,6 @@ return throttled; } - - // When a sequence of calls of the returned function ends, the argument // function is triggered. The end of a sequence is defined by the ‘wait’ From 037e9de24895dddcb783e09338c9c603e9be13f7 Mon Sep 17 00:00:00 2001 From: Ben Carp Date: Fri, 26 Jun 2020 15:18:13 +0300 Subject: [PATCH 3/4] Update underscore.js Co-authored-by: Julian Gonggrijp --- underscore.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/underscore.js b/underscore.js index 4ce1b0b67..fab328993 100644 --- a/underscore.js +++ b/underscore.js @@ -893,7 +893,7 @@ // When a sequence of calls of the returned function ends, the argument // function is triggered. The end of a sequence is defined by the ‘wait’ - // parameter. If ‘immediate’ is passed the argument function would be + // parameter. If ‘immediate’ is passed, the argument function will be // triggered at the beginning of the sequence as well. function debounce(func, wait, immediate) { var timeout, result; From 3219ed2740de594b7e3631ee7286d23878e175a2 Mon Sep 17 00:00:00 2001 From: ben-thinkpad-e480 Date: Fri, 26 Jun 2020 20:01:52 +0300 Subject: [PATCH 4/4] moving debounce comment to the new module structure --- modules/debounce.js | 8 ++++---- underscore-esm.js | 8 ++++---- underscore.js | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/modules/debounce.js b/modules/debounce.js index c77d9568e..99544650d 100644 --- a/modules/debounce.js +++ b/modules/debounce.js @@ -1,10 +1,10 @@ import restArguments from './restArguments.js'; import delay from './delay.js'; -// Returns a function, that, as long as it continues to be invoked, will not -// be triggered. The function will be triggered after it stops being called for -// N milliseconds. If `immediate` is passed, trigger the function on the -// leading edge, instead of the trailing. +// When a sequence of calls of the returned function ends, the argument +// function is triggered. The end of a sequence is defined by the ‘wait’ +// parameter. If ‘immediate’ is passed, the argument function will be +// triggered at the beginning of the sequence as well. export default function debounce(func, wait, immediate) { var timeout, result; diff --git a/underscore-esm.js b/underscore-esm.js index 9ce99ea53..2f7d37800 100644 --- a/underscore-esm.js +++ b/underscore-esm.js @@ -1015,10 +1015,10 @@ function throttle(func, wait, options) { return throttled; } -// Returns a function, that, as long as it continues to be invoked, will not -// be triggered. The function will be triggered after it stops being called for -// N milliseconds. If `immediate` is passed, trigger the function on the -// leading edge, instead of the trailing. +// When a sequence of calls of the returned function ends, the argument +// function is triggered. The end of a sequence is defined by the ‘wait’ +// parameter. If ‘immediate’ is passed, the argument function will be +// triggered at the beginning of the sequence as well. function debounce(func, wait, immediate) { var timeout, result; diff --git a/underscore.js b/underscore.js index 6b1339af3..6435f3e71 100644 --- a/underscore.js +++ b/underscore.js @@ -1023,7 +1023,7 @@ return throttled; } - + // When a sequence of calls of the returned function ends, the argument // function is triggered. The end of a sequence is defined by the ‘wait’ // parameter. If ‘immediate’ is passed, the argument function will be