mirror of
https://github.com/qier222/YesPlayMusic.git
synced 2025-02-28 21:19:47 +08:00
20 lines
452 B
TypeScript
20 lines
452 B
TypeScript
import { useQuery } from '@tanstack/react-query'
|
|
import { fetchAppleMusicArtist } from '../appleMusic'
|
|
|
|
const useAppleMusicArtist = (id: string | number) => {
|
|
return useQuery(
|
|
['useAppleMusicArtist', id],
|
|
async () => {
|
|
if (!id) return
|
|
return fetchAppleMusicArtist({ neteaseId: id })
|
|
},
|
|
{
|
|
enabled: !!id,
|
|
refetchOnWindowFocus: false,
|
|
refetchInterval: false,
|
|
}
|
|
)
|
|
}
|
|
|
|
export default useAppleMusicArtist
|