Rename _.debounce helper executeBoundFunction to complete.

This commit is contained in:
jdalton
2015-06-26 08:21:27 -07:00
parent a8c8bd8113
commit ec7dce7d5b

View File

@@ -7820,12 +7820,12 @@
maxTimeoutId = timeoutId = trailingCall = undefined;
}
function executeBoundFunction(shouldExecute, clearTimeoutId) {
if (clearTimeoutId) {
clearTimeout(clearTimeoutId);
function complete(isCalled, id) {
if (id) {
clearTimeout(id);
}
maxTimeoutId = timeoutId = trailingCall = undefined;
if (shouldExecute) {
if (isCalled) {
lastCalled = now();
result = func.apply(thisArg, args);
if (!timeoutId && !maxTimeoutId) {
@@ -7837,14 +7837,14 @@
function delayed() {
var remaining = wait - (now() - stamp);
if (remaining <= 0 || remaining > wait) {
executeBoundFunction(trailingCall, maxTimeoutId);
complete(trailingCall, maxTimeoutId);
} else {
timeoutId = setTimeout(delayed, remaining);
}
}
function maxDelayed() {
executeBoundFunction(trailing || (maxWait !== wait), timeoutId);
complete(trailing || (maxWait !== wait), timeoutId);
}
function debounced() {