import { routerReducer } from "react-router-redux" ; import { combineReducers } from "redux" ; import contracts from "../contracts" ; import templates from "../templates" ; import * as actions from "./actions" ; import * as types from "./types" ; export default function reducer ( state , action ) { switch ( action . type ) { case actions . RESET : return { contracts : contracts . reducer ( undefined , { } ) , templates : templates . reducer ( undefined , { } ) , routing : state . routing } ; default : return combineReducers ( { contracts : contracts . reducer , templates : templates . reducer , routing : routerReducer } ) ( state , action ) as types . AppState ; } }