summaryrefslogtreecommitdiff
path: root/frontend/src/sagas/home.js
diff options
context:
space:
mode:
authorVictor Chabbert <chabbertvi@eisti.eu>2017-05-22 22:47:20 +0200
committerVictor Chabbert <chabbertvi@eisti.eu>2017-05-22 22:47:20 +0200
commit3ff3b72f31b4a2647366c17dd2bbba0a8aae58e9 (patch)
tree22cd8ad06323babb4d625cb1e4aeec8834081521 /frontend/src/sagas/home.js
parentRevert to version number for flow-typed (diff)
downloadseven-wonders-3ff3b72f31b4a2647366c17dd2bbba0a8aae58e9.tar.gz
seven-wonders-3ff3b72f31b4a2647366c17dd2bbba0a8aae58e9.tar.bz2
seven-wonders-3ff3b72f31b4a2647366c17dd2bbba0a8aae58e9.zip
Move to prettier-eslint for better configuration
Diffstat (limited to 'frontend/src/sagas/home.js')
-rw-r--r--frontend/src/sagas/home.js16
1 files changed, 13 insertions, 3 deletions
diff --git a/frontend/src/sagas/home.js b/frontend/src/sagas/home.js
index 579c7fd6..3f06e8f3 100644
--- a/frontend/src/sagas/home.js
+++ b/frontend/src/sagas/home.js
@@ -7,12 +7,19 @@ import { actions, types } from '../redux/players';
function* sendUsername({ socket }) {
while (true) {
const { username } = yield take(types.REQUEST_CHOOSE_USERNAME);
- yield apply(socket, socket.send, ['/app/chooseName', JSON.stringify({ playerName: username })]);
+ yield apply(socket, socket.send, [
+ '/app/chooseName',
+ JSON.stringify({ playerName: username }),
+ ]);
}
}
function* validateUsername({ socket }) {
- const usernameChannel = yield call(createSubscriptionChannel, socket, '/user/queue/nameChoice');
+ const usernameChannel = yield call(
+ createSubscriptionChannel,
+ socket,
+ '/user/queue/nameChoice'
+ );
while (true) {
const user = yield take(usernameChannel);
yield put(actions.setCurrentPlayer(user));
@@ -23,7 +30,10 @@ function* validateUsername({ socket }) {
function* usernameChoiceSaga(wsConnection) {
// TODO: Run sendUsername in loop when we have the ability to cancel saga on route change
- yield [call(sendUsername, wsConnection), call(validateUsername, wsConnection)];
+ yield [
+ call(sendUsername, wsConnection),
+ call(validateUsername, wsConnection),
+ ];
}
export default usernameChoiceSaga;
bgstack15