Download apps/ui/src/components/views/github-issues-view/hooks/use-github-issues.ts from lekmikdok/hyp: direct link, hf CLI and curl.
- Browser
- Download file 676 Bytes
-
https://huggingface.co/spaces/lekmikdok/hyp/resolve/main/apps/ui/src/components/views/github-issues-view/hooks/use-github-issues.ts
- Command line
-
hf download hf://spaces/lekmikdok/hyp/apps/ui/src/components/views/github-issues-view/hooks/use-github-issues.ts
-
curl -L -o use-github-issues.ts https://huggingface.co/spaces/lekmikdok/hyp/resolve/main/apps/ui/src/components/views/github-issues-view/hooks/use-github-issues.ts
676 Bytes
| /** | |
| * GitHub Issues Hook | |
| * | |
| * React Query-based hook for fetching GitHub issues. | |
| */ | |
| import { useAppStore } from '@/store/app-store'; | |
| import { useGitHubIssues as useGitHubIssuesQuery } from '@/hooks/queries'; | |
| export function useGithubIssues() { | |
| const { currentProject } = useAppStore(); | |
| const { | |
| data, | |
| isLoading: loading, | |
| isFetching: refreshing, | |
| error, | |
| refetch: refresh, | |
| } = useGitHubIssuesQuery(currentProject?.path); | |
| return { | |
| openIssues: data?.openIssues ?? [], | |
| closedIssues: data?.closedIssues ?? [], | |
| loading, | |
| refreshing, | |
| error: error instanceof Error ? error.message : error ? String(error) : null, | |
| refresh, | |
| }; | |
| } | |