export function debounce(f: (...args: A) => void, timeout: number): (...args: A) => void { let interval: number | undefined = undefined return (...args: A) => { clearTimeout(interval) interval = setTimeout(() => f.apply(this, args), timeout) } }