Extract Spotify API calls into Custom Hooks
- Dominant language
- TypeScript
- Stars
- 1
- Forks
- 15
- PR merge metrics
- No merged PRs in 30d
Description
### Description
The data fetching logic inside the music page is quite complex and handles multiple endpoints at once. Extracting this business logic into custom hooks will make the component much cleaner.
### Tasks
- [ ] Create a new hook, e.g., `useSpotifyData`, in the `Frontend/src/hooks` folder.
- [ ] Move the `useEffect` that fetches top tracks, liked songs, and playlists into this hook.
- [ ] Return the fetched data, loading state, and error state from the hook.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by locating the music page component and its useEffect that fetches top tracks, liked songs, and playlists. Read the surrounding state and rendering logic before creating the hook in Frontend/src/hooks. Done means the fetching logic is provided by the hook and the page still receives fetched data, loading state, and error state.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend
- Issue type
- Refactor
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100