import { Action , SET_APPLICATION_STATE , } from '../actions' ; import { DEFAULT_STATE , State } from '../models/index' ; export param { Readonly < State > } state param { Action } action returns { Readonly < State > } export function stateReducer ( state = DEFAULT_STATE , action ) { switch ( action . type ) { case SET_APPLICATION_STATE : return action . payload . state ; } return state ; }