Skip to content

Refactor duplicated API request logic in useEffect #535

@Gokuleshkumar

Description

@Gokuleshkumar

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

  1. Reduces code duplication
  2. Improves code readability
  3. Makes the component easier to maintain

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions