chore: 用esbuild代替vite来打包main

This commit is contained in:
qier222 2022-03-29 16:52:53 +08:00
parent b4590c3c34
commit c4219afd3d
No known key found for this signature in database
GPG key ID: 9C85007ED905F14D
152 changed files with 669 additions and 747 deletions

View file

@ -1,24 +0,0 @@
import { fetchArtist } from '@/api/artist'
import { ArtistApiNames } from '@/api/artist'
import type { FetchArtistParams, FetchArtistResponse } 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: 5 * 60 * 1000, // 5 mins
placeholderData: (): FetchArtistResponse =>
window.ipcRenderer.sendSync('getApiCacheSync', {
api: 'artists',
query: {
id: params.id,
},
}),
}
)
}