Files
t3code/apps/web/src/hooks/useGitState.ts
T
2026-02-11 09:00:18 -08:00

13 lines
389 B
TypeScript

import { queryOptions, skipToken } from "@tanstack/react-query";
import { readNativeApi } from "../session-logic";
export const listBranchesQuery = (cwd: string | undefined) => {
const api = readNativeApi();
return queryOptions({
queryKey: ["git-branches", cwd],
queryFn: api && cwd ? () => api.git.listBranches({ cwd }) : skipToken,
refetchOnWindowFocus: true,
});
};