You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
14 lines
498 B
14 lines
498 B
import { useContext } from 'react' |
|
import { LiveActivitiesContext, type LiveActivitiesContextValue } from './live-activities-context' |
|
|
|
export function useLiveActivities(): LiveActivitiesContextValue { |
|
const ctx = useContext(LiveActivitiesContext) |
|
if (!ctx) { |
|
throw new Error('useLiveActivities must be used within LiveActivitiesProvider') |
|
} |
|
return ctx |
|
} |
|
|
|
export function useLiveActivitiesOptional(): LiveActivitiesContextValue | undefined { |
|
return useContext(LiveActivitiesContext) |
|
}
|
|
|