Commit a3d5b009 authored by Andreas Åkre Solberg's avatar Andreas Åkre Solberg

Add persist state middleware

parent 2bac5412
...@@ -4,14 +4,14 @@ import React from 'react' ...@@ -4,14 +4,14 @@ import React from 'react'
import ReactDOM from 'react-dom' import ReactDOM from 'react-dom'
import { combineReducers, createStore, applyMiddleware, compose } from 'redux' import { combineReducers, createStore, applyMiddleware, compose } from 'redux'
import { Provider } from 'react-redux' import { Provider } from 'react-redux'
// import promiseMiddleware from 'redux-promise'; import persistState from 'redux-localstorage'
import thunk from 'redux-thunk' import thunk from 'redux-thunk'
// import { connectRoutes } from 'redux-first-router' // import { connectRoutes } from 'redux-first-router'
// import createHistory from 'history/createBrowserHistory' // import createHistory from 'history/createBrowserHistory'
import reducers from './reducers/' import reducers from './reducers/'
import App from './containers/App' import App from './containers/App'
import API from './utils/API'
import logger from './middleware/logger' import logger from './middleware/logger'
// import { routesMap, options } from './routesMap' // import { routesMap, options } from './routesMap'
...@@ -29,6 +29,7 @@ import './css/style.css' ...@@ -29,6 +29,7 @@ import './css/style.css'
let store = createStore( let store = createStore(
reducers, reducers,
compose( compose(
persistState(),
applyMiddleware( applyMiddleware(
thunk, thunk,
logger logger
...@@ -59,6 +60,8 @@ let store = createStore( ...@@ -59,6 +60,8 @@ let store = createStore(
ReactDOM.render(( ReactDOM.render((
<Provider store={store}> <Provider store={store}>
<App /> <App />
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment