refactor redux data model

This commit is contained in:
seavor 2026-04-15 21:48:03 -05:00
parent ae1bc3da38
commit 0ff391491d
243 changed files with 5212 additions and 5963 deletions

View file

@ -9,47 +9,46 @@ export const Dispatch = {
},
updateRooms: (rooms: Data.ServerInfo_Room[]) => {
store.dispatch(Actions.updateRooms(rooms));
store.dispatch(Actions.updateRooms({ rooms }));
},
joinRoom: (roomInfo: Data.ServerInfo_Room) => {
store.dispatch(Actions.joinRoom(roomInfo));
store.dispatch(Actions.joinRoom({ roomInfo }));
},
leaveRoom: (roomId: number) => {
store.dispatch(Actions.leaveRoom(roomId));
store.dispatch(Actions.leaveRoom({ roomId }));
},
addMessage: (roomId: number, message: Enriched.Message) => {
store.dispatch(Actions.addMessage(roomId, message));
store.dispatch(Actions.addMessage({ roomId, message }));
},
updateGames: (roomId: number, games: Data.ServerInfo_Game[]) => {
store.dispatch(Actions.updateGames(roomId, games));
store.dispatch(Actions.updateGames({ roomId, games }));
},
userJoined: (roomId: number, user: Data.ServerInfo_User) => {
store.dispatch(Actions.userJoined(roomId, user));
store.dispatch(Actions.userJoined({ roomId, user }));
},
userLeft: (roomId: number, name: string) => {
store.dispatch(Actions.userLeft(roomId, name));
store.dispatch(Actions.userLeft({ roomId, name }));
},
sortGames: (roomId: number, field: App.GameSortField, order: App.SortDirection) => {
store.dispatch(Actions.sortGames(roomId, field, order));
store.dispatch(Actions.sortGames({ field, order }));
},
removeMessages: (roomId: number, name: string, amount: number) => {
store.dispatch(Actions.removeMessages(roomId, name, amount));
store.dispatch(Actions.removeMessages({ roomId, name, amount }));
},
gameCreated: (roomId: number) => {
store.dispatch(Actions.gameCreated(roomId));
store.dispatch(Actions.gameCreated({ roomId }));
},
joinedGame: (roomId: number, gameId: number) => {
store.dispatch(Actions.joinedGame(roomId, gameId));
store.dispatch(Actions.joinedGame({ roomId, gameId }));
}
}