import { SET_APP_CONFIG } from '../disptch-types'; import Store from './../../utils/Store'; let config = null; const saveAppConfigLocalized = (msg) => { Store.saveJsonObject('appConfig', msg) .then(res => { // console.log("saveAppConfigLocalized-s") }) .catch(e => { }) } const INITAL_STATE = config; export default function appConfigReducer(state = INITAL_STATE, action: any) { switch (action.type) { case SET_APP_CONFIG: saveAppConfigLocalized(action.config); return action.config; default: return state; } };