code: function debounce(delay, fn) {
  	let timer;
  	return function() {
  		let args = arguments;
  		if(timer) {
  			clearTimeout(timer);
  			timer = null;
  		}
  		timer = setTimeout(_ => {
  			fn.apply(null, args);
  			timer = null;
  		}, delay);
  	};
  }
docs: adapted from uitil <https://github.com/FND/uitil>