simpler-debounce

v1.0.0
Creates and returns a new debounced version of the passed function that will postpone its execution until after wait milliseconds have elapsed since the last time it was invoked

simpler-debounce

An implementation of debounce with significantly less code.

var debounce = require('debounce')
window.onresize = debounce(resize, 200)
 
function resize (e) {
  console.log('height', window.innerHeight)
  console.log('width', window.innerWidth)
}

debounce

debounce(fn, wait)

Creates and returns a new debounced version of the passed function that will postpone its execution until after wait milliseconds have elapsed since the last time it was invoked.

npm i simpler-debounce

Metadata

  • MIT
  • Whatever
  • Rico Sta. Cruz
  • released 1/1/2016

Downloads

Maintainers