You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Wording was ungrammatical and hard to understand. I made my best guess as to what you want to say. However, it is not clear from the description or the examples whether the debounce wrapper should inhibit calls attempted ms milliseconds after the last call that wasn't ignored, or ms milliseconds after the last call that was attempted, even if it was ignored. I would think it would be the former, but the example could go either way. If the f(4) example used 1000 or 1001 ms and still runs, that would clear it up. If it has to be 1100 like it is, that would suggest that it's the second scenario above. In my propsed change I preserved the ambiguity.
Copy file name to clipboardExpand all lines: 1-js/06-advanced-functions/09-call-apply-decorators/03-debounce/task.md
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ importance: 5
6
6
7
7
The result of `debounce(f, ms)` decorator should be a wrapper that passes the call to `f` at maximum once per `ms` milliseconds.
8
8
9
-
In other words, when we call a "debounced" function, it guarantees that all other future in the closest `ms` milliseconds will be ignored.
9
+
In other words, when we call a "debounced" function, it guarantees that all future calls to the function made less than `ms` milliseconds after the previous call will be ignored.
setTimeout( () =>f(5), 1500); // ignored (less than 1000 ms from the last run)
22
22
```
23
23
24
-
In practice `debounce` is useful for functions that retrieve/update something when we know that nothing new can be done in such a short period of time, so it's better not to waste resources.
24
+
In practice `debounce` is useful for functions that retrieve/update something when we know that nothing new can be done in such a short period of time, so it's better not to waste resources.
0 commit comments