All checks were successful
Deploy with Docker Compose / deploy (push) Successful in 3m16s
32 lines
624 B
TypeScript
32 lines
624 B
TypeScript
import { useLive, type LiveEvent } from './useLive';
|
|
|
|
interface UseWeatherLiveOptions {
|
|
sessionId: string;
|
|
currentUserId?: string;
|
|
enabled?: boolean;
|
|
onEvent?: (event: WeatherLiveEvent) => void;
|
|
}
|
|
|
|
interface UseWeatherLiveReturn {
|
|
isConnected: boolean;
|
|
lastEvent: WeatherLiveEvent | null;
|
|
error: string | null;
|
|
}
|
|
|
|
export type WeatherLiveEvent = LiveEvent;
|
|
|
|
export function useWeatherLive({
|
|
sessionId,
|
|
currentUserId,
|
|
enabled = true,
|
|
onEvent,
|
|
}: UseWeatherLiveOptions): UseWeatherLiveReturn {
|
|
return useLive({
|
|
sessionId,
|
|
apiPath: 'weather',
|
|
currentUserId,
|
|
enabled,
|
|
onEvent,
|
|
});
|
|
}
|