summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--frontend/src/sagas/gameBrowser.js4
-rw-r--r--frontend/src/sagas/usernameChoice.js8
2 files changed, 3 insertions, 9 deletions
diff --git a/frontend/src/sagas/gameBrowser.js b/frontend/src/sagas/gameBrowser.js
index 717cbd2a..2dbd4040 100644
--- a/frontend/src/sagas/gameBrowser.js
+++ b/frontend/src/sagas/gameBrowser.js
@@ -20,12 +20,10 @@ function gameBrowserChannel(socket) {
const newGame = socket.subscribe('/topic/games', makeHandler(types.CREATE_OR_UPDATE_GAMES))
const joinGame = socket.subscribe('/user/queue/lobby/joined', makeHandler(types.JOIN_GAME))
- const unsubscribe = () => {
+ return () => {
newGame.unsubscribe()
joinGame.unsubscribe()
}
-
- return unsubscribe
})
}
diff --git a/frontend/src/sagas/usernameChoice.js b/frontend/src/sagas/usernameChoice.js
index 60b7d327..da720e9f 100644
--- a/frontend/src/sagas/usernameChoice.js
+++ b/frontend/src/sagas/usernameChoice.js
@@ -10,16 +10,12 @@ function usernameValidationChannel(socket) {
const receiveUsernameHandler = socket.subscribe('/user/queue/nameChoice', event => {
emitter(fromJS(JSON.parse(event.body)))
})
-
- const unsubscribe = () => receiveUsernameHandler.unsubscribe()
-
- return unsubscribe
+ return () => receiveUsernameHandler.unsubscribe()
})
}
function *usernameValidation({ socket }) {
- const usernameChannel = usernameValidationChannel(socket)
-
+ const usernameChannel = yield call(usernameValidationChannel, socket)
const user = yield take(usernameChannel)
yield put(actions.setUsername(user.get('username'), user.get('displayName'), user.get('index')))
usernameChannel.close()
bgstack15