function proxy() {
      var timeStamp = Date.now()

      if (leadingCall) {
        // Reject immediately following calls.
        if (timeStamp - lastCallTime < trailingTimeout) {
          return
        } // Schedule new call to be in invoked when the pending one is resolved.
        // This is important for "transitions" which never actually start
        // immediately so there is a chance that we might miss one if change
        // happens amids the pending invocation.

        trailingCall = true
      } else {
        leadingCall = true
        trailingCall = false
        setTimeout(timeoutCallback, delay)
      }

      lastCallTime = timeStamp
    }
/**
     * Schedules invocation of the original function.
     *
     * @returns {void}
     */
Schedules invocation of the original function.
@returns {void}
Schedules invocation of the original function . @returns { void }
function proxy() {
      var timeStamp = Date.now()
      if (leadingCall) {
        if (timeStamp - lastCallTime < trailingTimeout) {
          return
        } 
        trailingCall = true
      } else {
        leadingCall = true
        trailingCall = false
        setTimeout(timeoutCallback, delay)
      }
      lastCallTime = timeStamp
    }
function proxy ( ) { var timeStamp = Date . now ( ) if ( leadingCall ) { if ( timeStamp - lastCallTime < trailingTimeout ) { return } trailingCall = true } else { leadingCall = true trailingCall = false setTimeout ( timeoutCallback , delay ) } lastCallTime = timeStamp }
Schedules invocation of the original function.
Schedules invocation of the original function .
// Reject immediately following calls. // Schedule new call to be in invoked when the pending one is resolved. // This is important for "transitions" which never actually start // immediately so there is a chance that we might miss one if change // happens amids the pending invocation.