We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
utils/throttle
If we are to keep the throttle function, it should be rewritten to return a wrapped function, as opposed to the current implementation.
throttle
Something like
const throttle = (fn, delay) => { let last = 0; return (...args) => { const now = new Date().getTime(); if (now - last < delay) { return; } last = now; return fn(...args); }; };
The text was updated successfully, but these errors were encountered:
No branches or pull requests
If we are to keep the
throttle
function, it should be rewritten to return a wrapped function, as opposed to the current implementation.Something like
The text was updated successfully, but these errors were encountered: