React & Modern Javascript
305 subscribers
43 photos
17 videos
15 files
245 links
React for Developers πŸš€πŸš€
Useful ArticlesπŸ“ƒ
DailyTips⚑️
Introduction videosπŸ’«
CoursesπŸ—ƒ
Covering the Updates of Modern Web Development!🌎

Link : t.me/ReactDev
Contact Us if You Have Any Questions or Suggestions:
@MrGh0st
@stfuBlyat
Download Telegram
Lets say that you have an input element in a webpage, and this input is responsible for a search bar mechanism.
and whenever there's a KeyPress Event, you would want to trigger the API call to fetch your data results for the search term, and update the view, very typical.

but what if the user abuse this behavior? that can easily lead to a high pressure on your server and even on your client. plus, the user doesn't really need to see the updates with each keystroke from his keyboard instantly. So how to fix this?

One clean and easy solution would be a Debounce mechanism. It will attach a 200ms(or any amount of time) to the latest event from the user's input. then and only then the search term is formed and being sent to the server, reducing the server and client load.

Debounce is only one of the cool things you can find in ReactiveX. A library for composing asynchronous and event-based programs

https://reactivex.io/intro.html
https://rxjs.dev/api/operators/debounce

#frontend #backend
@ReactDev πŸš€
React SPA Lazy Loading Pitfalls βš›οΈ

You should be lazy loading some of your routes. And if you are, you're probably messing up the data-fetching because it's an easy mistake to make.

πŸ”— https://bit.ly/3TMjud0

#react #frontend
@ReactDev πŸš€