Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
onPostPush() {
const routeConfig = RouterUtil.postPush(this.state.routeConfig);
this.setState({routeConfig});
}
const reducer = (state = initialState, action) => {
let routeConfig;
switch(action.type) {
case 'PUSH_PAGE':
const {route} = action;
routeConfig = state;
return RouterUtil.push({routeConfig, route});
case 'POST_PUSH':
return RouterUtil.postPush(state);
case 'POP_PAGE':
routeConfig = state;
return RouterUtil.pop({routeConfig});
case 'POST_POP':
return RouterUtil.postPop(state);
default:
return state;
}
};