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