import { Action , SET_CONFIG , } from '../actions' ; import { DEFAULT_VOYAGER_CONFIG , VoyagerConfig } from '../models/config' ; export function configReducer ( state = DEFAULT_VOYAGER_CONFIG , action ) { switch ( action . type ) { case SET_CONFIG : const { config } = action . payload ; const res = { ... state , ... config , } ; return res ; } return state ; }