mirror of
https://github.com/cryptpad/cryptpad.git
synced 2026-09-14 11:05:41 +05:00
implement a 'clear' method for throttled functions
This commit is contained in:
parent
49d79ee3e2
commit
240b6054fd
@ -310,6 +310,10 @@
|
||||
clearTimeout(to);
|
||||
to = setTimeout(Util.bake(f, Util.slice(arguments)), ms);
|
||||
};
|
||||
g.clear = function () {
|
||||
clearTimeout(to);
|
||||
to = undefined;
|
||||
};
|
||||
return g;
|
||||
};
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user