解决 debounce 当 immediate 入参 false 的时候,args无法被赋值,导致取不到入参的问题

解决 debounce 当 immediate 入参 false 的时候,args无法被赋值,导致取不到入参的问题
This commit is contained in:
MaYuanhai
2020-10-31 11:15:41 +08:00
committed by GitHub
parent 1bc2e5c198
commit e6ab249ce4

View File

@@ -271,7 +271,8 @@ export function debounce(func, wait, immediate) {
}
}
return function(...args) {
return function() {
args = arguments
context = this
timestamp = +new Date()
const callNow = immediate && !timeout