mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-08 18:17:48 +00:00
@@ -98,9 +98,11 @@ function debounce(func, wait, options) {
|
|||||||
function remainingWait(time) {
|
function remainingWait(time) {
|
||||||
const timeSinceLastCall = time - lastCallTime
|
const timeSinceLastCall = time - lastCallTime
|
||||||
const timeSinceLastInvoke = time - lastInvokeTime
|
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) {
|
function shouldInvoke(time) {
|
||||||
|
|||||||
Reference in New Issue
Block a user