I\'m trying to add debouncing with lodash to a search function, called from an input onChange event. The code below generates a type error \'function is expected\', which I unde
This worked for me:
handleChange(event) { event.persist(); const handleChangeDebounce = _.debounce((e) => { if (e.target.value) { // do something } }, 1000); handleChangeDebounce(event); }