react lodash debounce

This is my second post. Internally, it keeps the original value and generates a debounce function for a debounced value. Since line 6 encloses it with useCallback and an empty dependency list, this debouncedFunction will not change for the full lifetime of the hook. There is also a codesandbox link for you to play around. Can be used as drop-in replacement for or