implement a 'clear' method for throttled functions

pull/1/head
ansuz 4 years ago
parent 49d79ee3e2
commit 240b6054fd

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

Loading…
Cancel
Save