I\'ve got a function which takes in some arguments. But usage of underscore debounce is :
var lazyLayout = _.debounce(calculateLayout, 300);
Bu
@Jamie's answer is better.
I'll keep my original answer as below, although the it should be better to use Jamie's answer if you are familiar with JS:
var calculateLayout = function(a,b) {
console.log('a is ' + a + ' and b is ' + b);
}
var debounceCalculate = _.debounce(function(a, b){
calculateLayout(a, b);
}, 300);
debounceCalculate(1, 2);