export const debounce = (
	func: (that: any) => void,
	that: any,
	wait: number
): ((that: any) => void) => {
	let timeout: any;

	return function executedFunction() {
		const later = () => {
			clearTimeout(timeout);
			func(that);
		};

		clearTimeout(timeout);
		timeout = setTimeout(later, wait);
	};
};
