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:
Bas van Rossem
2026-02-19 16:21:22 +01:00
parent 5f275bfcc7
commit 06428f79cd
5 changed files with 231 additions and 0 deletions

13
web/src/socket.ts Normal file
View 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;