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>
This commit is contained in:
13
web/src/socket.ts
Normal file
13
web/src/socket.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
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;
|
||||
Reference in New Issue
Block a user