mirror of
https://github.com/bolucat/Archive.git
synced 2026-04-23 00:17:16 +08:00
18 lines
396 B
TypeScript
18 lines
396 B
TypeScript
import { unwrapResult } from '@/utils'
|
|
import { useQuery } from '@tanstack/react-query'
|
|
import { commands } from './bindings'
|
|
import { CORE_DIR_QUERY_KEY } from './consts'
|
|
|
|
export const useCoreDir = () => {
|
|
const query = useQuery({
|
|
queryKey: [CORE_DIR_QUERY_KEY],
|
|
queryFn: async () => {
|
|
return unwrapResult(await commands.getCoreDir())
|
|
},
|
|
})
|
|
|
|
return {
|
|
...query,
|
|
}
|
|
}
|