Update
Thanks to @Dominic Tobias and @gabdallah for spotting my embarrassing mistake.
The correct answer is of course;
so
Back in the old days before things got simpler for a developer people would listen to the popstate event on the history object ;)
It looks like the required info is on the action?
history.listen((error, nextRouterState) => {
...
store.dispatch(routerDidChange(nextRouterState));
and the action:
export function routerDidChange(state) {
return {
type: ROUTER_DID_CHANGE,
payload: state
};
}
So try checking action.payload
.
However your switch statement is using action
instead of action.type
so there's something fishy going on there.. You shouldn't need to do action = {}
either - see http://redux.js.org/docs/basics/Reducers.html