// 防抖
export function debounce(fn, wait) {
  let delay = wait || 200
  let timer
  return function() {
    let th = this
    let args = arguments
    if (timer) {
      clearTimeout(timer)
    }
    timer = setTimeout(function() {
      timer = null
      fn.apply(th, args)
    }, delay)
  }
}