mirror of
https://github.com/Jellify-Music/App.git
synced 2026-01-05 10:30:38 -06:00
10 lines
466 B
TypeScript
10 lines
466 B
TypeScript
import { useQuery } from "@tanstack/react-query";
|
|
import { QueryKeys } from "../enums/query-keys";
|
|
import { createApi } from "./queries/functions/api";
|
|
|
|
export const useApi = (serverUrl?: string, username?: string, password?: string, accessToken?: string) => useQuery({
|
|
queryKey: [QueryKeys.Api, serverUrl, username, password, accessToken],
|
|
queryFn: () => createApi(serverUrl, username, password, accessToken),
|
|
gcTime: 1000,
|
|
refetchInterval: false
|
|
}) |