Created
December 6, 2016 00:41
-
-
Save kuy/634fe6d21b3a570536f919e4283262b3 to your computer and use it in GitHub Desktop.
redux-saga-tower
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { put } from 'redux-saga/effects'; | |
import { router, createHashHistory } from 'redux-saga-router'; | |
import { changePage } from '../actions'; | |
import Home from '../pages/home'; | |
import SeriesNew from '../pages/series-new'; | |
const history = createHashHistory(); | |
const routes = { | |
'/': function* homePageSaga() { | |
console.log('home'); | |
yield put(changePage(Home)); | |
}, | |
'/series/new': function* seriesNewPageSaga() { | |
console.log('series.new'); | |
yield put(changePage(SeriesNew)); | |
}, | |
}; | |
export default function* routerSaga() { | |
yield* router(history, routes); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment