encountered a very confusing problem, because it needs to be used in the development of the shake,
so I wrote a function.
export function debounce(func, wait) {
var timer
return function (){
console.log(timer)
clearTimeout(timer)
timer = setTimeout( function () {
func(arguments)
}, wait)
}
}
is called in the place of the call:
onAfterChange= {debounce (this.onAfterChange.bind (this), 5000)}
then executed twice, this.onAfterChange. And timer was printed on it, and undefine was printed twice.