Как передать в callback delay ? Так не работает
const func = debounce(function (array = [], delay) {
...//
}, delay);
export default (fn, time) => {
let timeout;
return function() {
const functionCall = () => fn.apply(this, arguments);
clearTimeout(timeout);
timeout = setTimeout(functionCall, time);
};
};