kopia lustrzana https://github.com/pixelfed/pixelfed
				
				
				
			Add js debounce util
							rodzic
							
								
									a144301085
								
							
						
					
					
						commit
						4e3e23db36
					
				| 
						 | 
				
			
			@ -0,0 +1,11 @@
 | 
			
		|||
export function debounce (fn, delay) {
 | 
			
		||||
  var timeoutID = null
 | 
			
		||||
  return function () {
 | 
			
		||||
    clearTimeout(timeoutID)
 | 
			
		||||
    var args = arguments
 | 
			
		||||
    var that = this
 | 
			
		||||
    timeoutID = setTimeout(function () {
 | 
			
		||||
      fn.apply(that, args)
 | 
			
		||||
    }, delay)
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
		Ładowanie…
	
		Reference in New Issue