Skip to content

Commit

Permalink
Remove connections events listeners from the store file
Browse files Browse the repository at this point in the history
  • Loading branch information
tomivm committed Oct 19, 2023
1 parent c47e941 commit b8602ba
Showing 1 changed file with 0 additions and 16 deletions.
16 changes: 0 additions & 16 deletions src/store.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { createStore, applyMiddleware, compose } from 'redux';
import thunk from 'redux-thunk';
import { persistStore } from 'redux-persist';
import { UPDATE_CONNECTIVITY } from './components/App/App.constants';
import googleAnalytics from './analytics';
import createReducer from './reducers';

Expand All @@ -26,21 +25,6 @@ export default function configureStore(initialState = {}) {
composeEnhancers(...enhancers)
);

// TODO refactor not here
window.addEventListener('offline', () => {
store.dispatch({
type: UPDATE_CONNECTIVITY,
payload: false
});
});

window.addEventListener('online', () => {
store.dispatch({
type: UPDATE_CONNECTIVITY,
payload: true
});
});

const persistor = persistStore(store);

return { persistor, store };
Expand Down

0 comments on commit b8602ba

Please sign in to comment.