diff options
author | Joffrey BION <joffrey.bion@gmail.com> | 2018-04-30 00:22:26 +0200 |
---|---|---|
committer | Joffrey BION <joffrey.bion@gmail.com> | 2018-04-30 00:22:26 +0200 |
commit | ca90094c8fb30ffd29f6d53f2d2ac71f55a45e94 (patch) | |
tree | bfed2efbd9f0b94646eeb287b5188df4420901d5 /frontend/src/sagas/gameBrowser.js | |
parent | Remove unused history variable from rootSaga (diff) | |
download | seven-wonders-ca90094c8fb30ffd29f6d53f2d2ac71f55a45e94.tar.gz seven-wonders-ca90094c8fb30ffd29f6d53f2d2ac71f55a45e94.tar.bz2 seven-wonders-ca90094c8fb30ffd29f6d53f2d2ac71f55a45e94.zip |
Fix sagas types
Diffstat (limited to 'frontend/src/sagas/gameBrowser.js')
-rw-r--r-- | frontend/src/sagas/gameBrowser.js | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/frontend/src/sagas/gameBrowser.js b/frontend/src/sagas/gameBrowser.js index 95326a2b..7cd45667 100644 --- a/frontend/src/sagas/gameBrowser.js +++ b/frontend/src/sagas/gameBrowser.js @@ -1,6 +1,7 @@ // @flow import { normalize } from 'normalizr'; import { push } from 'react-router-redux'; +import type { SagaIterator } from 'redux-saga'; import { eventChannel } from 'redux-saga'; import { all, apply, call, put, take } from 'redux-saga/effects'; import type { SevenWondersSession } from '../api/sevenWondersApi'; @@ -8,7 +9,7 @@ import { actions as gameActions, types } from '../redux/games'; import { actions as playerActions } from '../redux/players'; import { game as gameSchema, gameList as gameListSchema } from '../schemas/games'; -function* watchGames(session: SevenWondersSession): * { +function* watchGames(session: SevenWondersSession): SagaIterator { const gamesChannel = yield eventChannel(session.watchGames()); try { while (true) { @@ -23,7 +24,7 @@ function* watchGames(session: SevenWondersSession): * { } } -function* watchLobbyJoined(session: SevenWondersSession): * { +function* watchLobbyJoined(session: SevenWondersSession): SagaIterator { const joinedLobbyChannel = yield eventChannel(session.watchLobbyJoined()); try { const joinedLobby = yield take(joinedLobbyChannel); @@ -38,7 +39,7 @@ function* watchLobbyJoined(session: SevenWondersSession): * { } } -function* createGame(session: SevenWondersSession): * { +function* createGame(session: SevenWondersSession): SagaIterator { while (true) { const { gameName } = yield take(types.REQUEST_CREATE_GAME); // $FlowFixMe @@ -46,7 +47,7 @@ function* createGame(session: SevenWondersSession): * { } } -function* joinGame(session: SevenWondersSession): * { +function* joinGame(session: SevenWondersSession): SagaIterator { while (true) { const { gameId } = yield take(types.REQUEST_JOIN_GAME); // $FlowFixMe @@ -54,7 +55,7 @@ function* joinGame(session: SevenWondersSession): * { } } -export function* gameBrowserSaga(session: SevenWondersSession): * { +export function* gameBrowserSaga(session: SevenWondersSession): SagaIterator { yield all([ call(watchGames, session), call(watchLobbyJoined, session), |