import { handleActions } from 'utils/store' ; const KEY_IS_OFFLINE = 'env.connection.isOffline' ; const reducers = { [ KEY_IS_OFFLINE ] : handleActions < typeof KEY_IS_OFFLINE > ( { CONNECTION_STATUS_CHANGED : ( state , { payload } ) => { if ( payload . isOffline !== undefined ) { return payload . isOffline ; } return state ; } , } , true ) , } ; export default reducers ; export const isAppOffline = ( state ) => state [ KEY_IS_OFFLINE ] ;