What to refactor
creating a service to load immutable data once
Why refactor it
to not make useless requests to the backend, since those data already loaded
How to refactor it
For example, when i am loading analysis page, there are two request going to the backend to fetch the users list.
and that is because the responsible component about trigger the request is UserSelection component,
and since it's rendered twice for User and Reviewer, it's triggering the request twice
and also in the Timesheet page, the customers list also loaded twice because of Tracking service, and also because of empty ReportRow component.
It will be better that we are making one service to fetch those endpoint once, and share those data across other pages, without needing to trigger the requests.
since the employees list and the customers list are very rare to be updated
Required
What to refactor
creating a service to load immutable data once
Why refactor it
to not make useless requests to the backend, since those data already loaded
How to refactor it
For example, when i am loading analysis page, there are two request going to the backend to fetch the users list.
and that is because the responsible component about trigger the request is
UserSelectioncomponent,and since it's rendered twice for
UserandReviewer, it's triggering the request twiceand also in the Timesheet page, the customers list also loaded twice because of Tracking service, and also because of empty
ReportRowcomponent.It will be better that we are making one service to fetch those endpoint once, and share those data across other pages, without needing to trigger the requests.
since the employees list and the customers list are very rare to be updated
Required