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>
14 lines
336 B
TypeScript
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;
|