mirror of
https://github.com/qier222/YesPlayMusic.git
synced 2025-03-01 01:38:39 +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
|