We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0f8b591 commit a5c6468Copy full SHA for a5c6468
1 file changed
demos/throttle/throttle2.js
@@ -12,17 +12,15 @@ container.onmousemove = throttle(getUserAction, 3000);
12
13
function throttle(func, wait) {
14
var timeout;
15
- var previous = 0;
16
17
return function() {
18
- context = this;
19
- args = arguments;
+ var context = this;
+ var args = arguments;
20
if (!timeout) {
21
timeout = setTimeout(function(){
22
timeout = null;
23
func.apply(context, args)
24
}, wait)
25
}
26
-
27
28
-}
+}
0 commit comments