Skip to content

Commit

Permalink
chore: added refetching
Browse files Browse the repository at this point in the history
  • Loading branch information
WomB0ComB0 committed Jan 25, 2025
1 parent 9e071bd commit cc7c872
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/components/music/NowPlaying.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ export default function NowPlaying() {
const { data, error, isLoading } = useQuery<NowPlayingData>({
queryKey: ['nowPlaying'],
queryFn: () => fetcher<NowPlayingData>('/api/v1/now-playing'),
staleTime: 1000 * 60 * 60,
refetchInterval: 1000 * 60 * 60,
});

return (
Expand Down
2 changes: 2 additions & 0 deletions src/components/music/TopArtists.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ export default function TopArtists() {
const { data, error, isLoading } = useQuery<string>({
queryKey: ['topArtists'],
queryFn: () => fetcher<string>('/api/v1/top-artists'),
staleTime: 1000 * 60 * 60,
refetchInterval: 1000 * 60 * 60,
});

let parsedData: Artist[] = [];
Expand Down
2 changes: 2 additions & 0 deletions src/components/music/TopTracks.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ export default function TopTracks() {
const { data, error, isLoading } = useQuery<string>({
queryKey: ['topTracks'],
queryFn: () => fetcher<string>('/api/v1/top-tracks'),
staleTime: 1000 * 60 * 60,
refetchInterval: 1000 * 60 * 60,
});

let parsedData: Track[] = [];
Expand Down

0 comments on commit cc7c872

Please sign in to comment.