Spaces:
Running on CPU Upgrade
Running on CPU Upgrade
Download web_app/src/hooks/useTopicOrganizations.ts from CommunityOne/open-navigator: direct link, hf CLI and curl.
- Browser
- Download file 632 Bytes
-
https://huggingface.co/spaces/CommunityOne/open-navigator/resolve/main/web_app/src/hooks/useTopicOrganizations.ts
- Command line
-
hf download hf://spaces/CommunityOne/open-navigator/web_app/src/hooks/useTopicOrganizations.ts
-
curl -L -o useTopicOrganizations.ts https://huggingface.co/spaces/CommunityOne/open-navigator/resolve/main/web_app/src/hooks/useTopicOrganizations.ts
632 Bytes
| import { useQuery } from '@tanstack/react-query' | |
| import { fetchTopicOrganizations, type TopicOrganizationsResponse } from '../api/topicOrganizations' | |
| /** The nonprofits tied to a topic in a place (#1345): one cache entry shared by the story screen and its headline. */ | |
| export function useTopicOrganizations(topic: string, stateCode?: string | null, city?: string | null) { | |
| return useQuery<TopicOrganizationsResponse>({ | |
| queryKey: ['topic-organizations', topic, stateCode ?? '', (stateCode && city) || ''], | |
| queryFn: () => fetchTopicOrganizations(topic, stateCode, city, 20), | |
| staleTime: 5 * 60_000, | |
| retry: 1, | |
| }) | |
| } | |