export function throttle(fn, interval) {
  let lastRunTime = 0

  return function (...args) {
    let elapsedTime = Date.now() - lastRunTime
    if (elapsedTime < interval) {
      return
    }

    let context = this
    lastRunTime = Date.now()
    fn.apply(context, args)
  }
}