const timers = new Map<string, ReturnType<typeof setTimeout>>()
export function debounced(key: string, fn: (v: string) => void, val: string, ms = 500) {
  clearTimeout(timers.get(key))
  timers.set(key, setTimeout(() => fn(val), ms))
}
