Files
yaak-mountain-loop/src-web/hooks/useOsInfo.ts
2023-04-27 10:19:49 -07:00

13 lines
328 B
TypeScript

import { useQuery } from '@tanstack/react-query';
import type { OsType } from '@tauri-apps/api/os';
import { type } from '@tauri-apps/api/os';
export function useOsInfo() {
return useQuery<{ osType: OsType }>({
queryKey: ['platform'],
queryFn: async () => {
return { osType: await type() };
},
}).data;
}