(fn: T, ms: number)
| 5 | |
| 6 | // Simple debounce function (no lodash dependency) |
| 7 | function debounce<T extends (...args: unknown[]) => void>(fn: T, ms: number): T { |
| 8 | let timer: ReturnType<typeof setTimeout>; |
| 9 | return ((...args: unknown[]) => { |
| 10 | clearTimeout(timer); |
| 11 | timer = setTimeout(() => fn(...args), ms); |
| 12 | }) as T; |
| 13 | } |
| 14 | |
| 15 | type Options = { |
| 16 | /** The id of the element to consider active by default */ |
no outgoing calls
no test coverage detected
searching dependent graphs…