DEV Community

Discussion on: Use lodash.debounce inside a function component in React

Collapse
 
kfunk profile image
Kevin Funk

This seems like an anti-pattern for how lodash.debounce is meant to be used. Sure it 'works', but new debounce functions are constantly being run. As a side effect, the additional options don't work. Try out using {maxWait: 500} (should wait at most, 500ms before firing the callback), it doesn't work.