Bump to v4.13.0.

This commit is contained in:
John-David Dalton
2016-05-21 01:14:43 -07:00
parent dbe6a9008c
commit 0cf3476f14
108 changed files with 1169 additions and 896 deletions

View File

@@ -65,7 +65,7 @@ function debounce(func, wait, options) {
maxWait,
result,
timerId,
lastCallTime = 0,
lastCallTime,
lastInvokeTime = 0,
leading = false,
maxing = false,
@@ -116,7 +116,7 @@ function debounce(func, wait, options) {
// Either this is the first call, activity has stopped and we're at the
// trailing edge, the system time has gone backwards and we're treating
// it as the trailing edge, or we've hit the `maxWait` limit.
return (!lastCallTime || (timeSinceLastCall >= wait) ||
return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||
(timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));
}
@@ -130,7 +130,6 @@ function debounce(func, wait, options) {
}
function trailingEdge(time) {
clearTimeout(timerId);
timerId = undefined;
// Only invoke if we have `lastArgs` which means `func` has been
@@ -143,11 +142,8 @@ function debounce(func, wait, options) {
}
function cancel() {
if (timerId !== undefined) {
clearTimeout(timerId);
}
lastCallTime = lastInvokeTime = 0;
lastArgs = lastThis = timerId = undefined;
lastInvokeTime = 0;
lastArgs = lastCallTime = lastThis = timerId = undefined;
}
function flush() {
@@ -168,7 +164,6 @@ function debounce(func, wait, options) {
}
if (maxing) {
// Handle invocations in a tight loop.
clearTimeout(timerId);
timerId = setTimeout(timerExpired, wait);
return invokeFunc(lastCallTime);
}