mirror of
https://github.com/GiriNeko/YesPlayMusic.git
synced 2025-12-17 13:48:02 +00:00
refactor: version 2.0 (React)
This commit is contained in:
parent
7dad7d810a
commit
950f72d4e8
356 changed files with 7901 additions and 29547 deletions
14
packages/renderer/src/hooks/useArtist.ts
Normal file
14
packages/renderer/src/hooks/useArtist.ts
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
import { fetchArtist } from '@/api/artist'
|
||||
import { ArtistApiNames } from '@/api/artist'
|
||||
import type { FetchArtistParams } from '@/api/artist'
|
||||
|
||||
export default function useArtist(params: FetchArtistParams, noCache: boolean) {
|
||||
return useQuery(
|
||||
[ArtistApiNames.FETCH_ARTIST, params],
|
||||
() => fetchArtist(params, noCache),
|
||||
{
|
||||
enabled: !!params.id && params.id > 0 && !isNaN(Number(params.id)),
|
||||
staleTime: 3600000,
|
||||
}
|
||||
)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue