I am trying to add a debounce effect on my useEffect as of right now, as soon as value in input changes it start to call the function inside it.
useEffect(() => {
if (inputValue.length > 0) {
fn();
}
}, [inputValue]);
Any suggestion how I can improve or implement a debounce effect here.