James-Lycett / workplace-wellness

0 stars 0 forks source link

Table Search and Sort functions, other little things #64

Closed James-Lycett closed 3 weeks ago

James-Lycett commented 3 weeks ago

I wrote a super simple search function for the employees table. It's a little slow which stack overflow leads me to believe is a result of updating search results on each keystroke rather than having a "search" button or something like that. I'm willing to sacrifice a little performance to leave it as it is. Update per keystroke is how I like my search bars but if your opinion differs we can change it. Might be able to improve performance a bit with a better search algorithm idk.

I had chatGPT figure out the sort logic for the entries table. It's a lot better than what I came up with. My machine overlord's apt use of the useMemo hook prompted me to learn more about memoization in general and I'm now motivated to add more of it throughout the codebase - should improve performance in certain key areas.

To test: Dashboard route is /dashboard/:userId

Changes:

James-Lycett commented 3 weeks ago

These changes have been migrated to james-auth branch, see pull request #67