char-fork/llama.cpp

git clone https://git.t4t.associates/char-fork/llama.cpp

Aleksander Grygierui: Restructure repo to use `tools/ui` folder and `ui` / `UI` / `llama-ui` / `LLAMA_UI` naming (#23064)59778f019

char/aliceai-t5-moe
512 B22 linesraw
1/**
2 * @param fn - The function to debounce
3 * @param delay - The delay in milliseconds
4 * @returns A debounced version of the function
5 */
6export function debounce<T extends (...args: Parameters<T>) => void>(
7	fn: T,
8	delay: number
9): (...args: Parameters<T>) => void {
10	let timeoutId: ReturnType<typeof setTimeout> | null = null;
11
12	return (...args: Parameters<T>) => {
13		if (timeoutId) {
14			clearTimeout(timeoutId);
15		}
16
17		timeoutId = setTimeout(() => {
18			fn(...args);
19			timeoutId = null;
20		}, delay);
21	};
22}