Nice video, we could've added a "loading..." state as well to show up when there is no data and an API call is pending, like below: {data && data.length > 0 && listbox(data, activeIndex)} ---> {isLoading && Loading...} ---> {query && !isLoading && data && data.length === 0 && noResultMessage()} {error && errorMessage()}
Thank you for making these videos. This really helps, and what stands out is your code is very professional and all other videos on RUclips looks like rookie level compared to yours.
Hi I've not used the lodash debounce but I debounced it using setTimeout in the useEffect Is this fine? useEffect(() => { if (!query) { setData(null); setError(null); return; } const controller = new AbortController(); const signal = controller.signal; const debounce = setTimeout(() => { fetchData(query, transformData, signal); }, debounceWait); return () => { clearTimeout(debounce); controller.abort(); }; }, [query, transformData, fetchData, debounceWait]); return [data, setData, error]; };
Hey, nope this won't be correct, If you are using debounce of your own then you have to write a polyfill for it. You can join us on discord and It is difficult for me to reply in comments discord.com/invite/YTZkV7By22
bhai itni badhia video banai k k mai netflix ko chorh k tujhe binge watch kar raha hu :D
Nice video, we could've added a "loading..." state as well to show up when there is no data and an API call is pending, like below:
{data && data.length > 0 && listbox(data, activeIndex)}
---> {isLoading && Loading...}
---> {query && !isLoading && data && data.length === 0 && noResultMessage()}
{error && errorMessage()}
Thank you for making these videos. This really helps, and what stands out is your code is very professional and all other videos on RUclips looks like rookie level compared to yours.
Great video Vedant, have been waiting for this from long time
Thanks man, i appreciate your commitment to provide a better content 👏
Thanks brother ❤, for creating such great content.
Since it is an interview, why not write the debouce function yourself ?
Next video on Carousel please
Bhai espe video banana please Build a search bar with denouncing and throttling
Hi
I've not used the lodash debounce but I debounced it using setTimeout in the useEffect
Is this fine?
useEffect(() => {
if (!query) {
setData(null);
setError(null);
return;
}
const controller = new AbortController();
const signal = controller.signal;
const debounce = setTimeout(() => {
fetchData(query, transformData, signal);
}, debounceWait);
return () => {
clearTimeout(debounce);
controller.abort();
};
}, [query, transformData, fetchData, debounceWait]);
return [data, setData, error];
};
Hey, nope this won't be correct, If you are using debounce of your own then you have to write a polyfill for it. You can join us on discord and It is difficult for me to reply in comments
discord.com/invite/YTZkV7By22
damn! why did i not discover your channel earlier
Thanks for the effort boss💙💙🙌🙌
i did not understand where did write Abortcontroller code?
where is the github link of this project bro?
How much time do company provide us to solve this problem in real interview?
Is this machine coding round ask in every company? Bhai
Hey where can i find these questions for interview preperation ?
jscafe.dev/
bhai sab ko searchbox component me as a prop kyu pas karte he, direct search box me hi use kyu nhi karte
To make search box customisable
So basically we need to pas props from parent as standard technique
There are other ways also, like composition