Fix EsLint config & update packages

This commit is contained in:
Ralex
2025-09-28 12:58:51 +02:00
parent dd841c813e
commit 89c39fac52
33 changed files with 2416 additions and 1641 deletions

View File

@@ -6,6 +6,7 @@ export function playerReducer(state, action) {
switch (action.type) {
case "JOIN":
return { player: { ...state.player, room: action.payload } }
case "LOGIN":
return {
player: {
@@ -14,10 +15,13 @@ export function playerReducer(state, action) {
points: 0,
},
}
case "UPDATE":
return { player: { ...state.player, ...action.payload } }
case "LOGOUT":
return { player: null }
default:
return state
}

View File

@@ -8,11 +8,9 @@ export const socket = io(WEBSOCKET_PUBLIC_URL, {
export const SocketContext = createContext()
export const SocketContextProvider = ({ children }) => {
return (
<SocketContext.Provider value={socket}>{children}</SocketContext.Provider>
)
}
export const SocketContextProvider = ({ children }) => (
<SocketContext.Provider value={socket}>{children}</SocketContext.Provider>
)
export function useSocketContext() {
const context = useContext(SocketContext)