diff options
author | Victor Chabbert <chabbertvi@eisti.eu> | 2017-07-24 23:51:21 +0200 |
---|---|---|
committer | Victor Chabbert <chabbertvi@eisti.eu> | 2017-08-07 22:41:20 +0200 |
commit | 620f354facfc28de31b02d46ca478b9abbaeae2c (patch) | |
tree | 3fc485909c761688a13a0964a66ed04a5498a10e /frontend/src | |
parent | Fix Map unexepected constructor argument by removing new keyword (diff) | |
download | seven-wonders-620f354facfc28de31b02d46ca478b9abbaeae2c.tar.gz seven-wonders-620f354facfc28de31b02d46ca478b9abbaeae2c.tar.bz2 seven-wonders-620f354facfc28de31b02d46ca478b9abbaeae2c.zip |
Remove redux-saga-router
Diffstat (limited to 'frontend/src')
-rw-r--r-- | frontend/src/routes.js | 21 | ||||
-rw-r--r-- | frontend/src/sagas.js | 9 |
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); } |