gordon-cs / gordon-360-ui

Gordon 360 User Interface
https://360.gordon.edu
16 stars 10 forks source link

Add debouncing to ui inputs #952

Open EjPlatzer opened 3 years ago

EjPlatzer commented 3 years ago

Debouncing will minimize the number of expensive calculations performed when a user is actively entering input. This is especially important for events and news search where filtering is computationally expensive.

We probably shouldn't debounce Quick Search, since the reactivity is important there.

silasw2 commented 2 years ago

If not used on quick people search, would we only be using this in Events and Involvements search?

A note on implementation, would it be a good choice to make a debouncing hook so that could be utilized anywhere on the site?

Let me know what you think and I will draft something up in the meantime!

EjPlatzer commented 2 years ago

events, involvements, and news are the places it would be most helpful for now.

And yes, this should definitely be a custom hook. There are some helpful guides online that can get you started if you just look up react debouncing hook.

silasw2 commented 2 years ago

Thanks for the reply! I'll get on that!

silasw2 commented 2 years ago

I see that there is a npm package for de-bouncing linked here. Are we interested in doing this with a package or should I come up with a more manual implementation.

EjPlatzer commented 2 years ago

Probably better to make our own in this case. This is something that can be implemented in a minimal amount of code and be transparent to future developers without being dependent on an external maintainer.

russtuck commented 3 months ago

This seems fast, and is only using CPU in the browser. So I'm not sure it's helpful or needed. At best very low priority.