aboutsummaryrefslogtreecommitdiff
path: root/src/view/client/lib/functions.ts
blob: 21fdad9b087f281ac81b32328d79942ca682f5c5 (plain)
1
2
3
4
5
6
7
export function debounce(func: Function, timeout: number): any {
  let timer: any
  return (...args: any) => {
    clearTimeout(timer)
    timer = setTimeout(() => { func.apply(this, args) }, timeout)
  }
}