mirror of
https://github.com/qier222/YesPlayMusic.git
synced 2025-03-01 07:19:55 +08:00
16 lines
570 B
TypeScript
16 lines
570 B
TypeScript
import { fetchUserArtists } from '@/web/api/user'
|
|
import { UserApiNames, FetchUserArtistsResponse } from '@/shared/api/User'
|
|
import { APIs } from '@/shared/CacheAPIs'
|
|
import { IpcChannels } from '@/shared/IpcChannels'
|
|
import { useQuery } from 'react-query'
|
|
|
|
export default function useUserArtists() {
|
|
return useQuery([UserApiNames.FetchUserArtist], fetchUserArtists, {
|
|
refetchOnWindowFocus: true,
|
|
placeholderData: (): FetchUserArtistsResponse =>
|
|
window.ipcRenderer?.sendSync(IpcChannels.GetApiCacheSync, {
|
|
api: APIs.UserArtists,
|
|
}),
|
|
})
|
|
}
|