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

解决 debounce 当 immediate 入参 false 的时候,args无法被赋值,导致取不到入参的问题
pull/3487/head
MaYuanhai 2020-10-31 11:15:41 +08:00 committed by GitHub
parent 1bc2e5c198
commit e6ab249ce4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

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