mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-09 02:17:50 +00:00
Rename _.debounce helper executeBoundFunction to complete.
This commit is contained in:
@@ -7820,12 +7820,12 @@
|
|||||||
maxTimeoutId = timeoutId = trailingCall = undefined;
|
maxTimeoutId = timeoutId = trailingCall = undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
function executeBoundFunction(shouldExecute, clearTimeoutId) {
|
function complete(isCalled, id) {
|
||||||
if (clearTimeoutId) {
|
if (id) {
|
||||||
clearTimeout(clearTimeoutId);
|
clearTimeout(id);
|
||||||
}
|
}
|
||||||
maxTimeoutId = timeoutId = trailingCall = undefined;
|
maxTimeoutId = timeoutId = trailingCall = undefined;
|
||||||
if (shouldExecute) {
|
if (isCalled) {
|
||||||
lastCalled = now();
|
lastCalled = now();
|
||||||
result = func.apply(thisArg, args);
|
result = func.apply(thisArg, args);
|
||||||
if (!timeoutId && !maxTimeoutId) {
|
if (!timeoutId && !maxTimeoutId) {
|
||||||
@@ -7837,14 +7837,14 @@
|
|||||||
function delayed() {
|
function delayed() {
|
||||||
var remaining = wait - (now() - stamp);
|
var remaining = wait - (now() - stamp);
|
||||||
if (remaining <= 0 || remaining > wait) {
|
if (remaining <= 0 || remaining > wait) {
|
||||||
executeBoundFunction(trailingCall, maxTimeoutId);
|
complete(trailingCall, maxTimeoutId);
|
||||||
} else {
|
} else {
|
||||||
timeoutId = setTimeout(delayed, remaining);
|
timeoutId = setTimeout(delayed, remaining);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function maxDelayed() {
|
function maxDelayed() {
|
||||||
executeBoundFunction(trailing || (maxWait !== wait), timeoutId);
|
complete(trailing || (maxWait !== wait), timeoutId);
|
||||||
}
|
}
|
||||||
|
|
||||||
function debounced() {
|
function debounced() {
|
||||||
|
|||||||
Reference in New Issue
Block a user