summaryrefslogtreecommitdiff
path: root/frontend/src/redux/actions/game.js
diff options
context:
space:
mode:
authorJoffrey BION <joffrey.bion@gmail.com>2019-05-03 00:43:11 +0200
committerJoffrey BION <joffrey.bion@gmail.com>2019-05-03 00:43:11 +0200
commitd7f9f2470b972fbdc5b9b0aec2f939f1799968c8 (patch)
treeca3eaf2c90769d1a71c52d24a2fab9e568f18ee6 /frontend/src/redux/actions/game.js
parentConvert api package to typescript (diff)
downloadseven-wonders-d7f9f2470b972fbdc5b9b0aec2f939f1799968c8.tar.gz
seven-wonders-d7f9f2470b972fbdc5b9b0aec2f939f1799968c8.tar.bz2
seven-wonders-d7f9f2470b972fbdc5b9b0aec2f939f1799968c8.zip
Convert redux actions to typescript
Diffstat (limited to 'frontend/src/redux/actions/game.js')
-rw-r--r--frontend/src/redux/actions/game.js34
1 files changed, 0 insertions, 34 deletions
diff --git a/frontend/src/redux/actions/game.js b/frontend/src/redux/actions/game.js
deleted file mode 100644
index 434aa8d3..00000000
--- a/frontend/src/redux/actions/game.js
+++ /dev/null
@@ -1,34 +0,0 @@
-import type { ApiPlayerMove, ApiPlayerTurnInfo, ApiPreparedCard, ApiTable } from '../../api/model';
-
-export const types = {
- REQUEST_SAY_READY: 'GAME/REQUEST_SAY_READY',
- REQUEST_PREPARE_MOVE: 'GAME/REQUEST_PREPARE_MOVE',
- PLAYER_READY_RECEIVED: 'GAME/PLAYER_READY_RECEIVED',
- TABLE_UPDATE_RECEIVED: 'GAME/TABLE_UPDATE_RECEIVED',
- PREPARED_CARD_RECEIVED: 'GAME/PREPARED_CARD_RECEIVED',
- TURN_INFO_RECEIVED: 'GAME/TURN_INFO_RECEIVED',
-};
-
-export type SayReadyAction = { type: 'GAME/REQUEST_SAY_READY' };
-export type PrepareMoveAction = { type: 'GAME/REQUEST_PREPARE_MOVE', move: ApiPlayerMove };
-export type PlayerReadyEvent = { type: 'GAME/PLAYER_READY_RECEIVED', username: string };
-export type TableUpdateEvent = { type: 'GAME/TABLE_UPDATE_RECEIVED', table: ApiTable };
-export type PreparedCardEvent = { type: 'GAME/PREPARED_CARD_RECEIVED', card: ApiPreparedCard };
-export type TurnInfoEvent = { type: 'GAME/TURN_INFO_RECEIVED', turnInfo: ApiPlayerTurnInfo };
-
-export type GameAction =
- SayReadyAction
- | PrepareMoveAction
- | PlayerReadyEvent
- | TableUpdateEvent
- | PreparedCardEvent
- | TurnInfoEvent;
-
-export const actions = {
- sayReady: () => ({ type: types.REQUEST_SAY_READY }),
- prepareMove: (move: ApiPlayerMove) => ({ type: types.REQUEST_PREPARE_MOVE, move }),
- receivePlayerReady: (username: string) => ({ type: types.PLAYER_READY_RECEIVED, username }),
- receiveTableUpdate: (table: ApiTable) => ({ type: types.TABLE_UPDATE_RECEIVED, table }),
- receivePreparedCard: (card: ApiPreparedCard) => ({ type: types.PREPARED_CARD_RECEIVED, card }),
- receiveTurnInfo: (turnInfo: ApiPlayerTurnInfo) => ({ type: types.TURN_INFO_RECEIVED, turnInfo }),
-};
bgstack15