Download src/js/util/throttle.js from merve/git-101: direct link, hf CLI and curl.
- Browser
- Download file 258 Bytes
-
https://huggingface.co/spaces/merve/git-101/resolve/main/src/js/util/throttle.js
- Command line
-
hf download hf://spaces/merve/git-101/src/js/util/throttle.js
-
curl -L -o throttle.js https://huggingface.co/spaces/merve/git-101/resolve/main/src/js/util/throttle.js
258 Bytes
| module.exports = function(func, time) { | |
| var wait = false; | |
| return function() { | |
| if (!wait) { | |
| func.apply(this, arguments); | |
| wait = true; | |
| setTimeout(function() { | |
| wait = false; | |
| }, time); | |
| } | |
| }; | |
| }; | |