TooLongDintRead
1 years ago
[LARP DB] about 30 lines of spaghetti code repeated through the app... shrunk to a single function call...???!
latest #7
TooLongDintRead
1 years ago
Long story short it's the function that checks your current login authorization, sees if you have the rights to view a page, if if you don't it just kicks you to the home page.
it's amazing and sad how much easier it can be isn't it??
I reduced my prev and next datepicker functions to like. a single click command. I felt so fucking stupid
立即下載
TooLongDintRead
1 years ago
In this case it's not really stupid, just starting out unfamiliar with what logic should be state based and what can be handled on render then pitched.
You're learning so fast ^_^
TooLongDintRead
1 years ago
But it's still crazy how much BETTER my code looks when I toss reusable logic into utility functions, handle state based logic on the main page then toss the 'stupid' data up to the child components.
TooLongDintRead
1 years ago
Was was using like, 3 useEffects per page and after redoing the main logic for the user roles list page I got it down to using only one to set up the state for the expand/collapse arrows.
back to top