Commit 53e85054 authored by Alexander Kotov's avatar Alexander Kotov

restore game state after page reload

parent 0f1b7b5c
......@@ -4,7 +4,12 @@ import rootReducer from './reducers'
const store = createStore(
rootReducer,
localStorage.state && JSON.parse(localStorage.state),
window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__()
)
store.subscribe(() => {
localStorage.setItem('state', JSON.stringify(store.getState()))
})
export default store
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