function debounce(callback, delay) {
	let timer;
	return (...args) => {
		if (timer) clearTimeout(timer);
		timer = setTimeout(() => callback.apply(this, args), delay);
	};
}
Debounces the provided callback with a given delay.
@param {Function} callback The callback that needs to be debounced.
@param {Number} delay Time in ms that the timer should wait before the callback is executed.
@returns {Function} Returns the new debounced function.