Merge pull request #2545 from LLyaudet/patch-6
avoid race condition in 06-advanced-functions/09-call-apply-decorator…
This commit is contained in:
commit
3b3f7c7eda
1 changed files with 1 additions and 2 deletions
|
@ -12,11 +12,10 @@ function throttle(func, ms) {
|
|||
savedThis = this;
|
||||
return;
|
||||
}
|
||||
isThrottled = true;
|
||||
|
||||
func.apply(this, arguments); // (1)
|
||||
|
||||
isThrottled = true;
|
||||
|
||||
setTimeout(function() {
|
||||
isThrottled = false; // (3)
|
||||
if (savedArgs) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue