From 821cde7afd12afee320f1bb12508d92624f8e52e Mon Sep 17 00:00:00 2001 From: crusader Date: Thu, 29 Jun 2017 16:58:51 +0900 Subject: [PATCH] ing --- src/ts/commons/redux/router.ts | 14 ++++++++++++++ src/ts/config/configureRedux.ts | 3 ++- 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 src/ts/commons/redux/router.ts 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';