Spaces:
Running on CPU Upgrade
Running on CPU Upgrade
Download web_app/src/hooks/useTopicUpcoming.ts from CommunityOne/open-navigator: direct link, hf CLI and curl.
- Browser
- Download file 599 Bytes
-
https://huggingface.co/spaces/CommunityOne/open-navigator/resolve/main/web_app/src/hooks/useTopicUpcoming.ts
- Command line
-
hf download hf://spaces/CommunityOne/open-navigator/web_app/src/hooks/useTopicUpcoming.ts
-
curl -L -o useTopicUpcoming.ts https://huggingface.co/spaces/CommunityOne/open-navigator/resolve/main/web_app/src/hooks/useTopicUpcoming.ts
599 Bytes
| import { useQuery } from '@tanstack/react-query' | |
| import { fetchTopicUpcoming, type TopicUpcomingResponse } from '../api/topicUpcoming' | |
| /** What is coming up on a topic (#1302): one cache entry shared by the story screen, its headline and the home card. */ | |
| export function useTopicUpcoming(topic: string, stateCode?: string | null, city?: string | null) { | |
| return useQuery<TopicUpcomingResponse>({ | |
| queryKey: ['topic-upcoming', topic, stateCode ?? '', (stateCode && city) || ''], | |
| queryFn: () => fetchTopicUpcoming(topic, stateCode, city, 24), | |
| staleTime: 5 * 60_000, | |
| retry: 1, | |
| }) | |
| } | |