任务
This commit is contained in:
11
tasks/task_010.txt
Normal file
11
tasks/task_010.txt
Normal file
@@ -0,0 +1,11 @@
|
||||
# Task ID: 10
|
||||
# Title: WebSocket Client Integration & State Management
|
||||
# Status: pending
|
||||
# Dependencies: 1, 9
|
||||
# Priority: high
|
||||
# Description: Integrate WebSocket client logic into the Taro frontend. Implement global state management (Zustand) to store connection status and received game messages, ensuring real-time UI updates.
|
||||
# Details:
|
||||
Create a WebSocket service/hook in the frontend to manage connection lifecycle (connect, disconnect, send, receive). Use Zustand to create a `GameStore` that holds `connectionState`, `user`, `room`, `gameState`. Update UI based on changes in `GameStore`. Implement message parsing and dispatching to relevant parts of the application.
|
||||
|
||||
# Test Strategy:
|
||||
Verify client can connect to WebSocket server. Send test messages from server and confirm client receives and updates state. Test reconnection logic (manual disconnect/reconnect).
|
||||
Reference in New Issue
Block a user