diff options
author | Joffrey BION <joffrey.bion@gmail.com> | 2019-05-16 23:48:38 +0200 |
---|---|---|
committer | Joffrey BION <joffrey.bion@gmail.com> | 2019-05-16 23:48:38 +0200 |
commit | 2382a452456e4bdef4584e1046925e372624cb79 (patch) | |
tree | 0e49b2e5d81facb55fb8b08228abeb218a27d466 /frontend/src/sagas/home.ts | |
parent | Remove GRADLE_METADATA feature to avoid breaking frontend build (diff) | |
download | seven-wonders-2382a452456e4bdef4584e1046925e372624cb79.tar.gz seven-wonders-2382a452456e4bdef4584e1046925e372624cb79.tar.bz2 seven-wonders-2382a452456e4bdef4584e1046925e372624cb79.zip |
Rationalize module names
Diffstat (limited to 'frontend/src/sagas/home.ts')
-rw-r--r-- | frontend/src/sagas/home.ts | 28 |
1 files changed, 0 insertions, 28 deletions
diff --git a/frontend/src/sagas/home.ts b/frontend/src/sagas/home.ts deleted file mode 100644 index 585c536e..00000000 --- a/frontend/src/sagas/home.ts +++ /dev/null @@ -1,28 +0,0 @@ -import { push } from 'react-router-redux'; -import { eventChannel, SagaIterator } from 'redux-saga'; -import { all, apply, call, put, take } from 'redux-saga/effects'; -import { ApiPlayer } from '../api/model'; -import { SevenWondersSession } from '../api/sevenWondersApi'; -import { actions, REQUEST_CHOOSE_USERNAME } from '../redux/actions/user'; - -function* sendUsername(session: SevenWondersSession): SagaIterator { - while (true) { - const { username } = yield take(REQUEST_CHOOSE_USERNAME); - // $FlowFixMe - yield apply(session, session.chooseName, [username]); - } -} - -function* validateUsername(session: SevenWondersSession): any { - const usernameChannel = yield eventChannel(session.watchNameChoice()); - while (true) { - const user: ApiPlayer = yield take(usernameChannel); - yield put(actions.setCurrentPlayer(user)); - yield apply(usernameChannel, usernameChannel.close); - yield put(push('/games')); - } -} - -export function* homeSaga(session: SevenWondersSession): SagaIterator { - yield all([call(sendUsername, session), call(validateUsername, session)]); -} |