summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoffrey BION <joffrey.bion@gmail.com>2017-02-03 01:00:40 +0100
committerJoffrey BION <joffrey.bion@gmail.com>2017-02-03 01:00:40 +0100
commite7e3cf9e276aadade8508d285f94c0eb1acb20a1 (patch)
tree081ce6e606af408f7954efde719c81f093168e39
parentAdd rebass button hover style (diff)
downloadseven-wonders-e7e3cf9e276aadade8508d285f94c0eb1acb20a1.tar.gz
seven-wonders-e7e3cf9e276aadade8508d285f94c0eb1acb20a1.tar.bz2
seven-wonders-e7e3cf9e276aadade8508d285f94c0eb1acb20a1.zip
Remove explicit unsubscribe declarations
-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