mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-01 07:47:49 +00:00
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user