Problem description
API request (axios.get) is duplicated inside the useEffect hook.
Expected Result
Use a reusable function to fetch contributor data.
Actual Result
The same API fetching logic appears twice (initial fetch and inside setInterval).
Proposed Solution
By Creating a function like fetchContributorData() and call it for both the initial load and interval to remove duplication and improve maintainability.
Benefits
- Reduces code duplication
- Improves code readability
- Makes the component easier to maintain