remove temp debounce
This commit is contained in:
@@ -190,33 +190,6 @@ export function sortComments(
|
||||
}
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// Debounce Utility
|
||||
// ============================================================================
|
||||
|
||||
/**
|
||||
* Debounces a function call to limit execution frequency
|
||||
* Useful for window resize and scroll events
|
||||
*/
|
||||
export function debounce<T extends (...args: any[]) => any>(
|
||||
func: T,
|
||||
wait: number
|
||||
): (...args: Parameters<T>) => void {
|
||||
let timeout: ReturnType<typeof setTimeout> | null = null;
|
||||
|
||||
return function executedFunction(...args: Parameters<T>) {
|
||||
const later = () => {
|
||||
timeout = null;
|
||||
func(...args);
|
||||
};
|
||||
|
||||
if (timeout !== null) {
|
||||
clearTimeout(timeout);
|
||||
}
|
||||
timeout = setTimeout(later, wait);
|
||||
};
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// Validation Utilities
|
||||
// ============================================================================
|
||||
|
||||
Reference in New Issue
Block a user