All checks were successful
Deploy with Docker Compose / deploy (push) Successful in 2m39s
34 lines
611 B
TypeScript
34 lines
611 B
TypeScript
'use client';
|
|
|
|
import { useLive, type LiveEvent } from './useLive';
|
|
|
|
interface UseSessionLiveOptions {
|
|
sessionId: string;
|
|
currentUserId?: string;
|
|
enabled?: boolean;
|
|
onEvent?: (event: LiveEvent) => void;
|
|
}
|
|
|
|
interface UseSessionLiveReturn {
|
|
isConnected: boolean;
|
|
lastEvent: LiveEvent | null;
|
|
error: string | null;
|
|
}
|
|
|
|
export function useSessionLive({
|
|
sessionId,
|
|
currentUserId,
|
|
enabled = true,
|
|
onEvent,
|
|
}: UseSessionLiveOptions): UseSessionLiveReturn {
|
|
return useLive({
|
|
sessionId,
|
|
apiPath: 'sessions',
|
|
currentUserId,
|
|
enabled,
|
|
onEvent,
|
|
});
|
|
}
|
|
|
|
export type { LiveEvent };
|