import merge from 'lodash/merge' ; import { SET_CONFIG , SetConfigAction } from '../actions' ; import { configDefault } from '../configDefault' ; import { Reducer } from '../util' ; const applyDefaultConfiguration = ( config = { } ) => merge ( { } , configDefault , config ) ; export const configReducer = ( state = applyDefaultConfiguration ( ) , action ) => { switch ( action . type ) { case SET_CONFIG : return applyDefaultConfiguration ( action . config ) ; default : return state ; } } ;