Debounce function with args underscore

You don’t need an anonymous function in the middle, arguments will automatically be passed to the original function when you run the debounced version.

  var debounceCalculate = _.debounce(calculateLayout, 300);
  debounceCalculate(a,b);

As an advantage you don’t have to hardcode-bind the arguments in advance

You can try it and if curious just check the source

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)