Files
spelljammer-ships/web/src/socket.ts
Bas van Rossem 06428f79cd feat(web): add zustand stores and Socket.IO client
Implements ship list store (REST-based) and ship detail store (Socket.IO-based)
with room join/leave, reconnection handling, and real-time event listeners.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 16:21:22 +01:00

14 lines
336 B
TypeScript

import { io } from 'socket.io-client';
// In development, Vite proxies /socket.io to the server.
// In production, both are served from the same origin.
const socket = io({
autoConnect: true,
reconnection: true,
reconnectionAttempts: Infinity,
reconnectionDelay: 1000,
reconnectionDelayMax: 5000,
});
export default socket;