src/index.js
function throttled (fn, delay) {
  let lastCall = 0
  return function (...args) {
    const now = new Date().getTime()
    if (now - lastCall < delay) {
      return
    }
    lastCall = now
    return fn(...args)
  }
}
function throttled (fn, delay) {
  let lastCall = 0
  return function (...args) {
    const now = new Date().getTime()
    if (now - lastCall < delay) {
      return
    }
    lastCall = now
    return fn(...args)
  }
}
function throttled ( fn , delay ) { let lastCall = 0 return function ( ... args ) { const now = new Date ( ) . getTime ( ) if ( now - lastCall < delay ) { return } lastCall = now return fn ( ... args ) } }
Creates a throttled function that only invokes func at most
once per every wait milliseconds.
@name throttled
@param  {Function} fn   Function to debounce
@param  {Number} delay  How long to wait
@return {Function}      Executed Function
Creates a throttled function that only invokes func at most once per every wait milliseconds .