rotem-horovitz
    _hello_about-me_games_projects_blog
find me in:
privacy
bio
1/**
2 * I’m Rotem, a Senior Frontend Developer
3 * and CSS Expert with over 16 years of
4 * experience building for the web. My
5 * journey began with hand-coding landing
6 * pages and has evolved into
7 * architecting robust design systems and
8 * frontend infrastructures for global
9 * platforms.
10 *
11 * I pride myself on being entirely
12 * self-taught, driven by a stubborn
13 * refusal to ship anything less than
14 * pixel-perfect. Whether I’m mentoring
15 * developers, interviewing new talent,
16 * or defining the next frontend stack,
17 * my goal is always the same: creating
18 * scalable, high-quality user
19 * experiences that last.
20 *
21 */

// Code snippet showcase:

L
@lurxCreated 5 months ago
1 details
3 stars
export function debounce<T extends (...args: unknown[]) => void>(
	fn: T,
	delay: number,
): (...args: Parameters<T>) => void {
	let timerId: Nullable<ReturnType<typeof setTimeout>> = null;
	return (...args: Parameters<T>) => {
		if (timerId !== null) clearTimeout(timerId);
		timerId = setTimeout(() => {
			fn(...args);
		}, delay);
	};
}
L
@lurxCreated 9 months ago
0 details
0 stars
export function chunk<T>(arr: T[], size: number): T[][] {
	if (size <= 0) throw new RangeError('Chunk size must be greater than 0');
	const result: T[][] = [];
	for (let index = 0; index < arr.length; index += size) {
		result.push(arr.slice(index, index + size));
	}
	return result;
}