fix(ts_web): resolve TypeScript nullability and event typing issues across web components
This commit is contained in:
@@ -21,9 +21,9 @@ export function throttle<T extends (...args: any[]) => any>(
|
||||
): (...args: Parameters<T>) => void {
|
||||
let inThrottle: boolean;
|
||||
|
||||
return function executedFunction(...args: Parameters<T>) {
|
||||
return (...args: Parameters<T>) => {
|
||||
if (!inThrottle) {
|
||||
func.apply(this, args);
|
||||
func(...args);
|
||||
inThrottle = true;
|
||||
setTimeout(() => inThrottle = false, limit);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user