feat: implement Weather Workshop feature with models, UI components, and session management for enhanced team visibility and personal well-being tracking
All checks were successful
Deploy with Docker Compose / deploy (push) Successful in 3m16s
All checks were successful
Deploy with Docker Compose / deploy (push) Successful in 3m16s
This commit is contained in:
31
src/hooks/useWeatherLive.ts
Normal file
31
src/hooks/useWeatherLive.ts
Normal file
@@ -0,0 +1,31 @@
|
||||
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,
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user