summaryrefslogtreecommitdiff
path: root/frontend/src
diff options
context:
space:
mode:
Diffstat (limited to 'frontend/src')
-rw-r--r--frontend/src/routes.js21
-rw-r--r--frontend/src/sagas.js9
2 files changed, 8 insertions, 22 deletions
diff --git a/frontend/src/routes.js b/frontend/src/routes.js
index 61c6aacd..b87977ef 100644
--- a/frontend/src/routes.js
+++ b/frontend/src/routes.js
@@ -1,26 +1,9 @@
// @flow
-import { fork } from 'redux-saga/effects';
-import { SevenWondersSession } from './api/sevenWondersApi';
-import Error404 from './components/errors/Error404';
+import { HomeLayout, LobbyLayout } from './layouts';
import GameBrowser from './containers/gameBrowser';
import HomePage from './containers/home';
import Lobby from './containers/lobby';
-import { HomeLayout, LobbyLayout } from './layouts';
-import gameBrowserSaga from './sagas/gameBrowser';
-import homeSaga from './sagas/home';
-import lobbySaga from './sagas/lobby';
-
-export const makeSagaRoutes = (sevenWondersSession: SevenWondersSession) => ({
- *'/'() {
- yield fork(homeSaga, sevenWondersSession);
- },
- *'/games'() {
- yield fork(gameBrowserSaga, sevenWondersSession);
- },
- *'/lobby/*'() {
- yield fork(lobbySaga, sevenWondersSession);
- },
-});
+import Error404 from './components/errors/Error404';
export const routes = [
{
diff --git a/frontend/src/sagas.js b/frontend/src/sagas.js
index a1f80c73..4a93ffb4 100644
--- a/frontend/src/sagas.js
+++ b/frontend/src/sagas.js
@@ -1,10 +1,11 @@
// @flow
import type { History } from 'react-router';
-import { router } from 'redux-saga-router';
import { call, fork } from 'redux-saga/effects';
import { connectToGame, SevenWondersSession } from './api/sevenWondersApi';
-import { makeSagaRoutes } from './routes';
import errorHandlingSaga from './sagas/errors';
+import homeSaga from './sagas/home';
+import gameBrowserSaga from './sagas/gameBrowser';
+import lobbySaga from './sagas/lobby';
export default function* rootSaga(history: History): * {
let sevenWondersSession: SevenWondersSession | void;
@@ -15,5 +16,7 @@ export default function* rootSaga(history: History): * {
return;
}
yield fork(errorHandlingSaga, sevenWondersSession);
- yield* router(history, makeSagaRoutes(sevenWondersSession));
+ yield fork(homeSaga, sevenWondersSession);
+ yield fork(gameBrowserSaga, sevenWondersSession);
+ yield fork(lobbySaga, sevenWondersSession);
}
bgstack15