Files
Jellify/src/api/mutations/home/index.ts
Violet Caulfield 5f59567d70 Discover Refactor (#752)
* Discover Refactor

tear down discover context provider

add animations to rows in discover screen

tidy up home screen refresh

* handle case where teh discover screen is empty on initial load
2025-12-05 04:49:32 -06:00

31 lines
978 B
TypeScript

import { useMutation } from '@tanstack/react-query'
import { useFrequentlyPlayedArtists, useFrequentlyPlayedTracks } from '../../queries/frequents'
import { useRecentArtists, useRecentlyPlayedTracks } from '../../queries/recents'
import { useUserPlaylists } from '../../queries/playlist'
const useHomeQueries = () => {
const { refetch: refetchUserPlaylists } = useUserPlaylists()
const { refetch: refetchRecentArtists } = useRecentArtists()
const { refetch: refetchRecentlyPlayed } = useRecentlyPlayedTracks()
const { refetch: refetchFrequentArtists } = useFrequentlyPlayedArtists()
const { refetch: refetchFrequentlyPlayed } = useFrequentlyPlayedTracks()
return useMutation({
mutationFn: async () => {
await Promise.allSettled([
refetchRecentlyPlayed(),
refetchFrequentlyPlayed(),
refetchUserPlaylists(),
])
await Promise.allSettled([refetchFrequentArtists(), refetchRecentArtists()])
return true
},
})
}
export default useHomeQueries