import { SET_NET_CONNECT } from '../disptch-types'; import Store from './../../utils/Store'; let isNetConnect = null; const saveIsNetConnectLocalized = (msg) => { Store.saveJsonObject('isNetConnect', msg) .then(res => { }) .catch(e => { }) } const INITAL_STATE = isNetConnect; export default function isNetConnectReducer(state = INITAL_STATE, action: any) { switch (action.type) { case SET_NET_CONNECT: saveIsNetConnectLocalized(action.isNetConnect); return action.isNetConnect; default: return state; } };