summaryrefslogtreecommitdiff
path: root/frontend/src/sagas.js
diff options
context:
space:
mode:
Diffstat (limited to 'frontend/src/sagas.js')
-rw-r--r--frontend/src/sagas.js24
1 files changed, 16 insertions, 8 deletions
diff --git a/frontend/src/sagas.js b/frontend/src/sagas.js
index 58ef73ee..2e34a0b7 100644
--- a/frontend/src/sagas.js
+++ b/frontend/src/sagas.js
@@ -1,12 +1,21 @@
-import { fork, call } from 'redux-saga/effects'
+import { router } from 'redux-saga-router'
+import { call } from 'redux-saga/effects'
import createWsConnection from './utils/createWebSocketConnection'
-import errorSaga from './containers/App/saga'
+
+// import errorSaga from './containers/App/saga'
import homeSaga from './containers/HomePage/saga'
-function* wsAwareSagas() {
- let wsConnection
+let wsConnection
+const routes = {
+ *'/'() {
+ yield console.info('home saga running')
+ yield homeSaga(wsConnection)
+ }
+}
+
+function* wsAwareSagas(history) {
try {
wsConnection = yield call(createWsConnection)
} catch (error) {
@@ -14,12 +23,11 @@ function* wsAwareSagas() {
return
}
- yield fork(errorSaga, wsConnection)
- yield fork(homeSaga, wsConnection)
+ yield* router(history, routes)
}
-export default function* rootSaga() {
+export default function* rootSaga(history) {
yield [
- call(wsAwareSagas)
+ call(wsAwareSagas, history)
]
}
bgstack15