Introduction
I have been writing React code for more than 3 years now. However, one thing that I didn’t focus on initially was optimizin...
For further actions, you may consider blocking this person and/or reporting abuse
Great stuff. Can anyone recommend a library for throttle/debounce? In the vue world we have VueUse for this sort of thing.
Debouncing is the simplest thing to do. Just code it.
Or am I missing something?
debounce + react async updates (useState, etc) + async fetch might be a bit more complex.
Write it yourselves. It's really not that hard.
I use aHooks and it really matter, because you can define what you need to execute on throttle or debounce. Also this lib can deal with loading status, auto refresh, etc.
You can look into the JS utility library such as Lodash and Underscore.
rxjs can do that. It used to be bundled with Angular. Not sure about now.
rxjs.dev/api/index/function/debounce
rxjs.dev/api/index/function/throttle
used rxjs on react and it's awesome. I'm not using for now, but I liked it.
You can check out "use-debounce" library too
Have a look on this library: usehooks-ts.com/
It supports many useful react hooks including debounce.
This is awesome, thanks for sharing mate!
Thanks, man.
Great post.
Great insights! Callstack has an excellent guide to React optimization as well :)
more informative
I am glad that you like it.
short and crisp
Yeah just like React Component.
Very informative 👏
Thank for sharing
React high order components could also optimise your code
nice
I don't even know how to use React (yet) what am I even doing ? Anyway it was such a helpful post 👏