![]() Techniques and caveats, described in the article, are relevant to any library or implementation, even if you decide to implement them by yourself. ![]() Side note: I’m going to use lodash library’s debounce and throttle functions. Let's take a brief look at what they are (in case you haven’t heard of them yet), and then focus on how to use them in React correctly - there are a few caveats there that a lot of people are not aware of! ![]() This is when such “slow down” techniques as “throttle” and “debounce” come in handy. Or your app to become unresponsive or even crash your browser window during scroll, just because you’re doing expensive calculations on every scroll event fired (there can be 30-100 per second of those!). The last thing that you want is an async search functionality to crash your web server, just because a user is typing too fast and you send requests on every keystroke. Slow and steady wins the race, you know □ Is it always true though? Contrary to common wisdom, sometimes it’s actually good to slow down and think about life. When talking about performance in general, and especially in React, the words “immediate”, “fast”, “as soon as possible” instantly come to mind.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |