summaryrefslogtreecommitdiff
path: root/frontend/src
diff options
context:
space:
mode:
Diffstat (limited to 'frontend/src')
-rw-r--r--frontend/src/routes.js7
1 files changed, 5 insertions, 2 deletions
diff --git a/frontend/src/routes.js b/frontend/src/routes.js
index 25e849de..a707c435 100644
--- a/frontend/src/routes.js
+++ b/frontend/src/routes.js
@@ -1,12 +1,15 @@
+import { spawn } from 'redux-saga/effects'
import usernameChoiceSaga from './sagas/usernameChoice'
import gameBrowserSaga from './sagas/gameBrowser'
+// TODO: Remove spawn saga when redux-saga-router has cancelable saga on route change
export const makeSagaRoutes = wsConnection => ({
*'/'() {
- yield usernameChoiceSaga(wsConnection)
+ // FIXME: spawn is a memory whore because the saga lives forever
+ yield spawn(usernameChoiceSaga, wsConnection)
},
*'/games'() {
- yield gameBrowserSaga(wsConnection)
+ yield spawn(gameBrowserSaga, wsConnection)
}
})
bgstack15