Slide 59
Slide 59 text
var debounceAutoComplete = (function(){
var timeWindow = 100;
var timeout;
!
var autoComplete = function(arg1, arg2){/* … */};
!
return function(){
var context = this;
var args = arguments;
clearTimeout(timeout);
timeout = setTimeout(function(){
autoComplete.apply(context, args);
}, timeWindow);
};
}());