avoid shadowing result (#3280)

related e908519fc3
This commit is contained in:
James
2017-07-25 15:06:15 -07:00
committed by John-David Dalton
parent 527b167bc5
commit 76c1ed2fd4

View File

@@ -98,9 +98,11 @@ function debounce(func, wait, options) {
function remainingWait(time) {
const timeSinceLastCall = time - lastCallTime
const timeSinceLastInvoke = time - lastInvokeTime
const result = wait - timeSinceLastCall
const timeWaiting = wait - timeSinceLastCall
return maxing ? Math.min(result, maxWait - timeSinceLastInvoke) : result
return maxing
? Math.min(timeWaiting, maxWait - timeSinceLastInvoke)
: timeWaiting
}
function shouldInvoke(time) {