Skip to content

Commit 3b3f7c7

Browse files
authored
Merge pull request #2545 from LLyaudet/patch-6
avoid race condition in 06-advanced-functions/09-call-apply-decorator…
2 parents 532b64f + c2cbc4c commit 3b3f7c7

File tree

1 file changed

+1
-2
lines changed
  • 1-js/06-advanced-functions/09-call-apply-decorators/04-throttle

1 file changed

+1
-2
lines changed

1-js/06-advanced-functions/09-call-apply-decorators/04-throttle/solution.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,10 @@ function throttle(func, ms) {
1212
savedThis = this;
1313
return;
1414
}
15+
isThrottled = true;
1516

1617
func.apply(this, arguments); // (1)
1718

18-
isThrottled = true;
19-
2019
setTimeout(function() {
2120
isThrottled = false; // (3)
2221
if (savedArgs) {

0 commit comments

Comments
 (0)