Skip to content

Commit

Permalink
Refactor index.js to use store configuration file (#1666)
Browse files Browse the repository at this point in the history
  • Loading branch information
marcinbodnar committed May 12, 2021
1 parent 461eac2 commit dd7641d
Showing 1 changed file with 2 additions and 23 deletions.
25 changes: 2 additions & 23 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(
<Provider store={store}>
<PersistGate loading={null} persistor={persistor}>
Expand Down

0 comments on commit dd7641d

Please sign in to comment.