diff options
author | Joffrey BION <joffrey.bion@gmail.com> | 2019-05-03 00:43:11 +0200 |
---|---|---|
committer | Joffrey BION <joffrey.bion@gmail.com> | 2019-05-03 00:43:11 +0200 |
commit | d7f9f2470b972fbdc5b9b0aec2f939f1799968c8 (patch) | |
tree | ca3eaf2c90769d1a71c52d24a2fab9e568f18ee6 /frontend/src/redux/actions/lobby.js | |
parent | Convert api package to typescript (diff) | |
download | seven-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/lobby.js')
-rw-r--r-- | frontend/src/redux/actions/lobby.js | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/frontend/src/redux/actions/lobby.js b/frontend/src/redux/actions/lobby.js deleted file mode 100644 index 8768ec80..00000000 --- a/frontend/src/redux/actions/lobby.js +++ /dev/null @@ -1,34 +0,0 @@ -import type { ApiLobby } from '../../api/model'; - -export const types = { - UPDATE_GAMES: 'GAMES/UPDATE_GAMES', - REQUEST_CREATE_GAME: 'GAMES/REQUEST_CREATE_GAME', - REQUEST_JOIN_GAME: 'GAMES/REQUEST_JOIN_GAME', - REQUEST_START_GAME: 'GAMES/REQUEST_START_GAME', - ENTER_LOBBY: 'GAMES/ENTER_LOBBY', - ENTER_GAME: 'GAMES/ENTER_GAME', -}; - -export type UpdateGamesAction = { type: 'GAMES/UPDATE_GAMES', games: ApiLobby[]}; -export type RequestCreateGameAction = { type: 'GAMES/REQUEST_CREATE_GAME', gameName: string }; -export type RequestJoinGameAction = { type: 'GAMES/REQUEST_JOIN_GAME', gameId: number }; -export type RequestStartGameAction = { type: 'GAMES/REQUEST_START_GAME' }; -export type EnterLobbyAction = { type: 'GAMES/ENTER_LOBBY', gameId: number }; -export type EnterGameAction = { type: 'GAMES/ENTER_GAME', gameId: number }; - -export type LobbyAction = - | UpdateGamesAction - | RequestCreateGameAction - | RequestJoinGameAction - | RequestStartGameAction - | EnterLobbyAction - | EnterGameAction; - -export const actions = { - updateGames: (games: ApiLobby[]): UpdateGamesAction => ({ type: types.UPDATE_GAMES, games }), - requestJoinGame: (gameId: number): RequestJoinGameAction => ({ type: types.REQUEST_JOIN_GAME, gameId }), - requestCreateGame: (gameName: string): RequestCreateGameAction => ({ type: types.REQUEST_CREATE_GAME, gameName }), - requestStartGame: (): RequestStartGameAction => ({ type: types.REQUEST_START_GAME }), - enterLobby: (gameId: number): EnterLobbyAction => ({ type: types.ENTER_LOBBY, gameId }), - enterGame: (gameId: number): EnterGameAction => ({ type: types.ENTER_GAME, gameId }), -}; |