implement a 'clear' method for throttled functions

This commit is contained in:
ansuz 2020-07-15 13:00:52 -04:00
parent 49d79ee3e2
commit 240b6054fd

View File

@ -310,6 +310,10 @@
clearTimeout(to);
to = setTimeout(Util.bake(f, Util.slice(arguments)), ms);
};
g.clear = function () {
clearTimeout(to);
to = undefined;
};
return g;
};