Initial structure
This commit is contained in:
parent
ecb354cf6e
commit
874bd18f11
14 changed files with 157 additions and 1 deletions
17
src/store/game/game.ts
Normal file
17
src/store/game/game.ts
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
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 };
|
||||
Loading…
Add table
Add a link
Reference in a new issue