Closed stefanocudini closed 8 years ago
function debouncer(func, timeout) { var timeoutID; timeout = timeout || 300; return function () { var scope = this , args = arguments; clearTimeout( timeoutID ); timeoutID = setTimeout( function () { func.apply( scope , Array.prototype.slice.call( args ) ); }, timeout); }; }