knowyt/_client/src/store/game.js

21 lines
376 B
JavaScript

export const state = () => ({
state: "",
phase: "",
name: "",
})
export const mutations = {
setStateAndPhase(state, game) {
if (game) {
const { state: gameState, phase, name } = game
state.state = gameState
state.phase = phase
state.name = name
} else {
state.state = ""
state.phase = ""
state.name = ""
}
},
}