hotfix throttle function args
This commit is contained in:
@@ -53,13 +53,14 @@ export function throttle<T>(
|
||||
let timeout: number | null = null;
|
||||
let previous = 0;
|
||||
// tslint:disable-next-line: only-arrow-functions
|
||||
return function(args: T) {
|
||||
return function(arg: T) {
|
||||
let now = Date.now();
|
||||
if (!previous && options.leading === false) {
|
||||
previous = now;
|
||||
}
|
||||
let remaining = wait - (now - previous);
|
||||
let context = this;
|
||||
let args = arguments;
|
||||
if (remaining <= 0 || remaining > wait) {
|
||||
if (timeout) {
|
||||
window.clearTimeout(timeout);
|
||||
|
||||
Reference in New Issue
Block a user