From dd7641dae81296d9ade56999e901e0d71861de7c Mon Sep 17 00:00:00 2001 From: marcinbodnardesktop Date: Wed, 12 May 2021 22:01:57 +0200 Subject: [PATCH] Refactor index.js to use store configuration file (#1666) --- src/index.js | 25 ++----------------------- 1 file changed, 2 insertions(+), 23 deletions(-) diff --git a/src/index.js b/src/index.js index 532cba5554..df09610e5e 100644 --- a/src/index.js +++ b/src/index.js @@ -4,36 +4,15 @@ import React from 'react' import ReactDOM from 'react-dom' import { initSentry } from './utils/sentry' - -import { createStore } from 'redux' - -import { persistStore, persistReducer } from 'redux-persist' -import storage from 'redux-persist/lib/storage' -import { PersistGate } from 'redux-persist/integration/react' - import { Provider } from 'react-redux' import { LocalizeProvider } from 'react-localize-redux'; -import { createBrowserHistory } from 'history' - -import createRootReducer from './reducers' -import createMiddleware from './middleware' +import { PersistGate } from 'redux-persist/integration/react' import Routing from './components/Routing' +import { store, persistor, history } from './redux/store' initSentry(); -const persistConfig = { - key: 'root', - storage, -} - -const history = createBrowserHistory() - -const persistedReducer = persistReducer(persistConfig, createRootReducer(history)) - -export const store = createStore(persistedReducer, createMiddleware(history)) -let persistor = persistStore(store) - ReactDOM.render(