mirror of
https://github.com/GiriNeko/YesPlayMusic.git
synced 2025-12-16 13:17:46 +00:00
19 lines
447 B
TypeScript
19 lines
447 B
TypeScript
import { useQuery } from '@tanstack/react-query'
|
|
import { fetchAppleMusicAlbum } from '../appleMusic'
|
|
|
|
const useAppleMusicAlbum = (id: string | number) => {
|
|
return useQuery(
|
|
['useAppleMusicAlbum', id],
|
|
async () => {
|
|
if (!id) return
|
|
return fetchAppleMusicAlbum({ neteaseId: id })
|
|
},
|
|
{
|
|
enabled: !!id,
|
|
refetchOnWindowFocus: false,
|
|
refetchInterval: false,
|
|
}
|
|
)
|
|
}
|
|
|
|
export default useAppleMusicAlbum
|