Medium
Complete the missing code in this custom hook that implements a debounced search functionality:
1function useDebounceSearch(initialQuery = '') {2 const [query, setQuery] = useState(initialQuery);3 const [debouncedQuery, setDebouncedQuery] = useState(initialQuery);45 useEffect(() => {6 // Missing implementation7 ____________________8 ____________________9 ____________________10 ____________________11 }, [query]);1213 return {14 query,15 debouncedQuery,16 setQuery,17 };18}