Here’s my take on a lodash.debounce hook. I don’t see why the hook shouldn’t be more convenient to use, so I basically made a useState wrapper which updates the value immediately (a requirement for controlled inputs), and updates a signal, which is meant to be used in a useEffect’s dependency array, only whenever specified as per lodash.debounce’s docs.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Here’s my take on a
lodash.debounce
hook. I don’t see why the hook shouldn’t be more convenient to use, so I basically made auseState
wrapper which updates the value immediately (a requirement for controlled inputs), and updates asignal
, which is meant to be used in auseEffect
’s dependency array, only whenever specified as perlodash.debounce
’s docs.