I have a code like that:
var originalFunction = function() {
return 'some value';
};
var debouncedFunction = _.debounce(originalFunction, 3000);
console.log('debouncedFunction() result: ', debouncedFunction());
console.log('originalFunction() result: ', originalFunction());
And the result in the console is:
debouncedFunction() result: undefined
originalFunction() result: some value
As you can see, the debounced function doesn't return anything. I understand that it's caused by an internal timer in the debounced function, but is there away around that?