1export const DEBOUNCE_WAIT_TIME = 1750; 2 3export function debounce(func, wait) { 4 let timeout; 5 const debouncedFunction = function executedFunction(...args) { 6 const later = () => { 7 clearTimeout(timeout); 8 func(...args); 9 }; 10 11 clearTimeout(timeout); 12 timeout = setTimeout(later, wait); 13 }; 14 15 // Adding a method to cancel the debounced function 16 debouncedFunction.cancel = function() { 17 if (timeout) { 18 clearTimeout(timeout); 19 } 20 }; 21 22 return debouncedFunction; 23};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.