diff --git a/src/ts/commons/redux/router.ts b/src/ts/commons/redux/router.ts new file mode 100644 index 0000000..6322e29 --- /dev/null +++ b/src/ts/commons/redux/router.ts @@ -0,0 +1,14 @@ +import Action from 'commons/redux/Action'; +import { RouterState, LocationActionPayload, LOCATION_CHANGE } from 'react-router-redux'; + +export const initRouterState: RouterState = { + location: null, +}; + + +export function routerReducer(state: RouterState = initRouterState, action: Action): RouterState { + if (action.type === LOCATION_CHANGE) { + return state; + } + return state; +} diff --git a/src/ts/config/configureRedux.ts b/src/ts/config/configureRedux.ts index 5d865f2..1d40bd6 100644 --- a/src/ts/config/configureRedux.ts +++ b/src/ts/config/configureRedux.ts @@ -1,7 +1,8 @@ import { Action, combineReducers } from 'redux'; -import { routerReducer, RouterState } from 'react-router-redux'; +import { RouterState, LocationActionPayload, LOCATION_CHANGE } from 'react-router-redux'; import { SagaIterator } from 'redux-saga'; import { fork } from 'redux-saga/effects'; +import { routerReducer } from 'commons/redux/router'; import * as Member from 'member';