license import { Reducer } from 'redux' ; import { UPDATE_LOCATION } from '../actions/app.js' ; import { RootAction , RootState } from '../store.js' ; export interface AppState { view ? : string ; list ? : string ; page ? : number ; id ? : string ; } ; const app = ( state = { } , action ) => { switch ( action . type ) { case UPDATE_LOCATION : return { ... state , view : action . view , list : action . list , page : action . page , id : action . id } ; default : return state ; } } ; export default app ; export const idSelector = ( state ) => state . app . id ;