pulsar-web/src/store/game/game.ts
2025-12-30 16:57:07 +01:00

17 lines
490 B
TypeScript

import { fetchTime } from "../../services/game/game";
import { GameAction } from "./actions";
import { IGameState } from "./types";
function gameReducer(state: IGameState, action: GameAction): IGameState {
switch (action.type) {
case "FETCH_TIME_START":
fetchTime();
return { ...state };
case "FETCH_TIME_FINISH":
return { ...state, time: action.payload };
default:
return state;
}
}
export { gameReducer };