mirror of
https://github.com/GiriNeko/YesPlayMusic.git
synced 2025-12-17 13:48:02 +00:00
feat: monorepo
This commit is contained in:
parent
4d54060a4f
commit
42089d4996
200 changed files with 1530 additions and 1521 deletions
18
packages/web/hooks/usePersonalFM.ts
Normal file
18
packages/web/hooks/usePersonalFM.ts
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
import { fetchPersonalFM, PersonalFMApiNames } from '@/web/api/personalFM'
|
||||
import reactQueryClient from '@/web/utils/reactQueryClient'
|
||||
|
||||
export function fetchPersonalFMWithReactQuery() {
|
||||
return reactQueryClient.fetchQuery(
|
||||
PersonalFMApiNames.FetchPersonalFm,
|
||||
async () => {
|
||||
const data = await fetchPersonalFM()
|
||||
if (!data.data?.length) {
|
||||
throw new Error('No data')
|
||||
}
|
||||
return data
|
||||
},
|
||||
{
|
||||
retry: 3,
|
||||
}
|
||||
)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue