aboutsummaryrefslogtreecommitdiffstats
path: root/javascript/helpers.js
blob: 1b26931fa4c5376c10fe0b3c97aa49fcb89a7e1c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
// helper functions

function debounce(func, wait_time) {
	let timeout;
	return function wrapped(...args) {
		let call_function = () => {
			clearTimeout(timeout);
			func(...args)
		}
		clearTimeout(timeout);
		timeout = setTimeout(call_function, wait_time);
	};
}